<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Sushi Train - RJM Programming - November, 2017</title>
<style>
td { width: 12%; height: 25%; border: 1px solid red; text-align: center; font-size: 40px; }
.f1:before { content: '\01f371' }
.f2:before { content: '\01f358' }
.f3:before { content: '\01f359' }
.f4:before { content: '\01f35a' }
.f5:before { content: '\01f35b' }
.f6:before { content: '\01f35c' }
.f7:before { content: '\01f35d' }
.f8:before { content: '\01f360' }
.f9:before { content: '\01f362' }
.f10:before { content: '\01f363' }
.f11:before { content: '\01f364' }
.f12:before { content: '\01f365' }
.f13:before { content: '\01f361' }
.f14:before { content: '\01F366' }
.f15:before { content: '\01F367' }
.f16:before { content: '\01F368' }
.f17:before { content: '\01F369' }
.f18:before { content: '\01F36A' }
.f19:before { content: '\01F382' }
.f0:before { content: '\01F370' }
.tlcorner {
-webkit-border-top-left-radius: 30%;
-moz-border-top-left-radius: 30%;
border-top-left-radius: 30%;
border-bottom: solid 1px yellow;
}
.blcorner {
-webkit-border-bottom-left-radius: 30%;
-moz-border-bottom-left-radius: 30%;
border-bottom-left-radius: 30%;
border-top: solid 1px yellow;
}
.trcorner {
-webkit-border-top-right-radius: 30%;
-moz-border-top-right-radius: 30%;
border-top-right-radius: 30%;
border-bottom: solid 1px yellow;
}
.brcorner {
-webkit-border-bottom-right-radius: 30%;
-moz-border-bottom-right-radius: 30%;
border-bottom-right-radius: 30%;
border-top: solid 1px yellow;
}
.xtlcorner {
-webkit-border-top-left-radius: 15%;
-moz-border-top-left-radius: 15%;
border-top-left-radius: 15%;
}
.xblcorner {
-webkit-border-bottom-left-radius: 15%;
-moz-border-bottom-left-radius: 15%;
border-bottom-left-radius: 15%;
}
.xtrcorner {
-webkit-border-top-right-radius: 15%;
-moz-border-top-right-radius: 15%;
border-top-right-radius: 15%;
}
.xbrcorner {
-webkit-border-bottom-right-radius: 15%;
-moz-border-bottom-right-radius: 15%;
border-bottom-right-radius: 15%;
}
//1674 U+1F371 🍱 🍱 🍱 🍱 🍱 🍱 🍱 🍱 🍱 🍱 — 🍱 bento box
//1675 U+1F358 🍘 🍘 🍘 🍘 🍘 🍘 🍘 🍘 🍘 🍘 — 🍘 rice cracker
//1676 U+1F359 🍙 🍙 🍙 🍙 🍙 🍙 🍙 🍙 🍙 🍙 🍙 🍙 rice ball
//1677 U+1F35A 🍚 🍚 🍚 🍚 🍚 🍚 🍚 🍚 🍚 🍚 — 🍚 cooked rice
//1678 U+1F35B 🍛 🍛 🍛 🍛 🍛 🍛 🍛 🍛 🍛 🍛 — 🍛 curry rice
//1679 U+1F35C 🍜 🍜 🍜 🍜 🍜 🍜 🍜 🍜 🍜 🍜 🍜 🍜 steaming bowl
//1680 U+1F35D 🍝 🍝 🍝 🍝 🍝 🍝 🍝 🍝 🍝 🍝 — 🍝 spaghetti
//1681 U+1F360 🍠 🍠 🍠 🍠 🍠 🍠 🍠 🍠 🍠 — — 🍠 roasted sweet potato
//1682 U+1F362 🍢 🍢 🍢 🍢 🍢 🍢 🍢 🍢 🍢 🍢 — 🍢 oden
//1683 U+1F363 🍣 🍣 🍣 🍣 🍣 🍣 🍣 🍣 🍣 🍣 — 🍣 sushi
//1684 U+1F364 🍤 🍤 🍤 🍤 🍤 🍤 🍤 🍤 🍤 — — 🍤 fried shrimp
//1685 U+1F365 🍥 🍥 🍥 🍥 🍥 🍥 🍥 🍥 🍥 — — 🍥 fish cake with swirl
//1686 U+1F361 🍡 🍡 🍡 🍡 🍡 🍡 🍡 🍡 🍡 🍡 — 🍡 dango
//1687 U+1F95F 🥟 🥟 🥟 🥟 🥟 🥟 — 🥟 — — — — ⊛ dumpling
//1688 U+1F960 🥠 🥠 🥠 🥠 🥠 🥠 — 🥠 — — — — ⊛ fortune cookie
//1689 U+1F961
//1690 U+1F366 🍦 🍦 🍦 🍦 🍦 🍦 🍦 🍦 🍦 🍦 — 🍦 soft ice cream
//1691 U+1F367 🍧 🍧 🍧 🍧 🍧 🍧 🍧 🍧 🍧 🍧 — 🍧 shaved ice
//1692 U+1F368 🍨 🍨 🍨 🍨 🍨 🍨 🍨 🍨 🍨 — — 🍨 ice cream
//1693 U+1F369 🍩 🍩 🍩 🍩 🍩 🍩 🍩 🍩 🍩 — — 🍩 doughnut
//1694 U+1F36A 🍪 🍪 🍪 🍪 🍪 🍪 🍪 🍪 🍪 — — 🍪 cookie
//1695 U+1F382 🎂 🎂 🎂 🎂 🎂 🎂 🎂 🎂 🎂 🎂 🎂 🎂 birthday cake
//1696 U+1F370 🍰 🍰 🍰 🍰 🍰 🍰 🍰 🍰 🍰 🍰 🍰 🍰 shortcake
</style>
<script type='text/javascript'>
var foods=[], ifood=0;
var huh=[0,1,2,3,4,5,6,7,9,11,19,18,17,16,15,14,13,12,10,8];
var huhx=[0,1,2,3,4,5,6,7,10,12,20,19,18,17,16,15,14,13,11,8];
var back=[];
var scores=[0,0,0,0];
var goes=[0,0,0,0];
var times=[0,0,0,0];
var thisplayer=0;
var menu=['shortcake;5.00','bento box;8.00','rice cracker;0.80','rice ball;1.20','cooked rice;2.50','curry rice;3.00','steaming bowl;4.00','spaghetti;6.00','roasted sweet potato;0.80','oden;2.70','sushi;2.00','fried shrimp;2.10','fish cake with swirl;0.60','dango;2.85','soft ice cream;0.55','shaved ice;0.30','ice cream;0.90','doughnut;0.58','cookie;0.35','birthday cake;3.40'];
var lasturl=["","","",""];
var lastscnt=[1,1,1,1];
function placefood() {
var ii=0, jj=0, ioffset=0, ie=null;
var tds=document.getElementsByTagName('td');
if (foods.length == 0) {
for (ii=0; ii<tds.length; ii++) {
if (('' + tds[ii].id) != 'midbit') {
foods.push('f' + Math.floor(Math.random() * 19));
back.push(0);
}
}
//alert(foods.length + ' ' + menu.length + ' ' + tds.length);
jj=0;
ioffset=0;
for (ii=0; ii<tds.length; ii++) {
if (('' + tds[ii].id) != 'midbit') {
//foods[huh[jj]]=('f' + Math.floor(Math.random() * 19));
//document.title=' huhx[' + jj + ']';
tds[eval(huhx[jj])].className+=' ' + foods[huh[jj]];
tds[eval(huhx[jj])].title=menu[eval(foods[huh[jj]].replace('f',''))].split(';')[0];
if (menu[eval(foods[huh[jj]].replace('f',''))].split(';').length > 1) tds[eval(huhx[jj])].alt=menu[eval(foods[huh[jj]].replace('f',''))].split(';')[1];
jj++;
} else {
ioffset=1;
}
}
ifood=1;
} else {
jj=0;
ioffset=0;
for (ii=0; ii<tds.length; ii++) {
if (('' + tds[ii].id) != 'midbit') {
if (tds[eval(huhx[jj])].className.indexOf(' nothing') == -1 || 1 == 1) {
tds[eval(huhx[jj])].className=tds[eval(huhx[jj])].className.split(' f')[0] + ' ' + foods[eval(eval(huh[eval((jj + ifood) % huh.length)]))];
back[eval(huhx[jj])]=eval(eval(huh[eval((jj + ifood) % huh.length)]));
try {
tds[eval(huhx[jj])].title=menu[eval(foods[eval(eval(huh[eval((jj + ifood) % huh.length)]))].replace('f',''))].split(';')[0];
if (menu[eval(foods[eval(eval(huh[eval((jj + ifood) % huh.length)]))].replace('f',''))].split(';').length > 1) tds[eval(huhx[jj])].alt=menu[eval(foods[eval(eval(huh[eval((jj + ifood) % huh.length)]))].replace('f',''))].split(';')[1];
} catch(ie) {
}
}
jj++;
} else {
ioffset=1;
}
}
ifood++;
}
setTimeout(placefood, 2000);
}
function onc(otd) {
var ii=0, jj=0, ioffset=0, thisc='';
//document.title=otd.className;
var tds=document.getElementsByTagName('td');
for (ii=0; ii<tds.length; ii++) {
if (tds[ii] === otd) {
jj=ii;
}
}
var vsf=otd.className.split(' f');
if (vsf.length > 1) thisc='f' + otd.className.split(' f')[1];
if (otd.className.indexOf(' nothing') == -1 && 1 == 2) {
otd.className=vsf[0] + ' nothing'; // + ' ' + otd.className.replace(vsf[0] + ' ','');
//alert(otd.className);
} else if (foods[huh[jj]] != '') {
//foods[huhx[jj]]='';
//document.title='' + jj + ' ' + thisc + ' vs ' + foods[eval(eval(huh[eval((eval(jj + ifood) + 1) % huh.length)]))] + ' Vs ' + + foods[eval(eval(huh[eval((eval(jj + ifood) + 0) % huh.length)]))] + ' VS ' + + foods[eval(eval(huh[eval((eval(jj + ifood) - 1) % huh.length)]))];
//foods[eval(eval(huh[eval((jj + ifood) % huh.length)]))]='';
goes[thisplayer]++;
if (foods[back[jj]] != '') {
var scnt=1;
var localiurl="localized_currency.html";
var localidelim="?";
if (('' + otd.alt) == '') {
scores[thisplayer]+=0; //=price[];
} else {
//document.title=Math.floor(eval(otd.alt) * 100.0);
scores[thisplayer]+=Math.floor(eval(otd.alt) * 100.0); //=price[];
if (document.getElementById('order' + thisplayer).innerHTML == '') {
document.getElementById('order' + thisplayer).innerHTML='<br><span id=sc' + thisplayer + 'nt' + scnt + '>$' + (otd.alt + '00').substring(0,4) + ' ' + otd.title + '</span><br>';
localiurl+=localidelim + 'called' + scnt + '=' + encodeURIComponent('sc' + thisplayer + 'nt' + scnt + '`' + otd.alt + ' ' + otd.title);
localidelim='&';
scnt++;
} else {
if (scnt == 1) {
localiurl=lasturl[thisplayer];
localidelim='&';
scnt=lastscnt[thisplayer];
}
document.getElementById('order' + thisplayer).innerHTML+='<span id=sc' + thisplayer + 'nt' + scnt + '>$' + (otd.alt + '00').substring(0,4) + ' ' + otd.title + '</span><br>';
localiurl+=localidelim + 'called' + scnt + '=' + encodeURIComponent('sc' + thisplayer + 'nt' + scnt + '`' + otd.alt + ' ' + otd.title);
localidelim='&';
scnt++;
}
}
if (localiurl.indexOf('?') != -1) {
document.getElementById('locali').src=localiurl;
lasturl[thisplayer]=localiurl;
lastscnt[thisplayer]=scnt;
}
if (times[thisplayer] != 0) times[thisplayer]=1;
}
document.getElementById('score' + thisplayer).innerHTML='<a style="cursor:pointer;text-decoration:underline;" onclick="showeats(' + thisplayer + ');">Score</a>: ' + scores[thisplayer] + '/' + goes[thisplayer]
foods[back[jj]]='';
}
}
function showeats(weis) {
document.getElementById('order' + weis).style.display='inline';
}
function timeit() {
if (times[thisplayer] == 1) {
times[thisplayer]=0;
thisplayer=eval(eval(1 + thisplayer) % 4);
times[thisplayer]=6;
} else {
times[thisplayer]--;
}
for (var jk=0; jk<4; jk++) {
if (jk == thisplayer) {
document.getElementById('score' + jk).style.fontWeight='bold';
} else {
document.getElementById('score' + jk).style.fontWeight='normal';
}
}
setTimeout(timeit,1000);
}
</script>
</head>
<body style='background-color: white;' onload='thisplayer=Math.floor(Math.random() * 4); times[thisplayer]=6; setTimeout(timeit,1000); placefood();'>
<div style='float:left;'><input type='text' value='Player1'></input> <span style='display:none;color:blue;' id='order0'></span> <span id='score0'>Score: 0/0</span><br><br></div><div style='float:right;'><input type='text' value='Player2'></input> <span style='display:none;color:blue;' id='order1'></span> <span id='score1'>Score: 0/0</span><br><br></div>
<div style='background-color: white;'>
<table cellspacing=0 cellpadding=0 style='width:100%;height:60vh; background-color: yellow;'>
<tr style='width:100%;'><td onclick='onc(this);' class='tlcorner'></td><td onclick='onc(this);' style='border-bottom:1px solid yellow;'></td><td onclick='onc(this);' class='cell'></td><td onclick='onc(this);' class='cell'></td><td onclick='onc(this);' class='cell'></td><td onclick='onc(this);' class='cell'></td><td onclick='onc(this);' class='cell' style='border-bottom:1px solid yellow;'></td><td onclick='onc(this);' class='trcorner'></td></tr>
<tr style='width:100%;'><td onclick='onc(this);' class='cell' style='border-top:1px solid yellow;'><hr style='border-color:red; margin-top: -75px;'></hr></td><td id='midbit' style=' background-color:white; ' colspan=6 rowspan=2 class=' xtlcorner xblcorner xtrcorner xbrcorner '><div style='width:100%;text-align:center;'>Sushi Train - RJM Programming - November, 2017</div></td><td onclick='onc(this);' style='border-top:1px solid yellow;'><hr style='border-color:red; margin-top:-75px;'></hr></td></tr>
<tr style='width:100%;'><td onclick='onc(this);' class='cell' style='border-bottom:1px solid yellow;'><hr style='border-color:red; margin-top: 40px;'></hr></td><td onclick='onc(this);' style='border-bottom:1px solid yellow;'><hr style='border-color:red; margin-top: 40px;'></hr></td></tr>
<tr style='width:100%;'><td onclick='onc(this);' class='blcorner'></td><td onclick='onc(this);' style='border-top:1px solid yellow;'></td><td onclick='onc(this);' class='cell'></td><td onclick='onc(this);' class='cell'></td><td onclick='onc(this);' class='cell'></td><td onclick='onc(this);' class='cell'></td><td onclick='onc(this);' class='cell' style='border-top:1px solid yellow;'></td><td onclick='onc(this);' class='brcorner'></td></tr>
</table>
<div style='float:left;'><br><br><input type='text' value='Player3'></input> <span style='display:none;color:blue;' id='order2'></span> <span id='score2'>Score: 0/0</span></div><div style='float:right;'><br><br><input type='text' value='Player4'></input> <span style='display:none;color:blue;' id='order3'></span> <span id='score3'>Score: 0/0</span></div>
</div>
<iframe src='localized_currency.html' style='display:none;' id='locali'></iframe>
</body>
</html>