Tag Archives: FormData

Just Javascript Five Hundred Card Game Open Misère Wording Tutorial

With our 500 card game web application of yesterday’s Just Javascript Five Hundred Card Game Open Misère Tutorial the bidding of Misère and Open Misère bring an unusual dilemma to do with email communication. Even though we hate to confuse we need to weigh … the desire in Misère and Open Misère for the bidder to lose tricks (rather than the usual way the winning bidder wants to win tricks) … against the use of … double negatives may cause confusion … and decide on the danger of a bit of “double negatives may cause confusion” because we think most 500 card game players will get it as soon as they see the word “Misère” mentioned, coupled with the awkward sentences used (where “subjis” is variable containing email subject content) … if ((!in_bidding && !in_kitty) && ((cbid + ‘ ‘).substring(0,3).toLowerCase() == ‘mis’ || eval(” + omc) >= 0)) { spare=subjis; if (((” + curplayer) == (” + omc) || (” + curplayer) == (” + omh) || (” + curplayer) == (” + cbidby)) && (spare.indexOf(‘Congratulations’) == 0)) { subjis=’Opposite of ‘ + spare; } else if (((” + curplayer) == (” + omc) || (” + curplayer) == (” + omh) || (” + curplayer) == (” + cbidby)) && (spare.indexOf(‘Bad luck’) == 0)) { subjis=’Good luck is ‘ + spare; } else if (((” + curplayer) != (” + omc) && (” + curplayer) != (” + omh) && eval(” + omc) >= 0) && (spare.indexOf(‘Congratulations’) == 0)) { subjis=’Sad news about ‘ + spare; } else if (((” + curplayer) != (” + cbidby) && eval(” + omc) < 0) && (spare.indexOf(‘Congratulations’) == 0)) { subjis=’Sad news about ‘ + spare; } } subjis=subjis.replace(‘&#232;’, String.fromCodePoint(232)).replace(‘open_’, ‘open ‘).replace(‘&#232;’, String.fromCodePoint(232)).replace(‘open_’, ‘open ‘); As well, we sort it out that … players can no longer see bidding buttons of irrelevance (bidding has already passed them by) on the emails the open hand card links and buttons in the emails navigate nowhere (except when it is the open hand players turn to play a card) Again, feel free to retry the improved 500 card game part of our changed cards_usefocus.html code behind the “Just Javascript” Memories Card Game or live run with single window (good for mobile) or default live run (for your platform, and if non-mobile it will try child popup windows). Try adding “.0” to number of card players to play (our hybrid) “500” card game, and optionally wait or immediately append a comma separated email/SMS address/number list for your “500 card game” players (who can affect the game remotely via email)! Previous relevant Just Javascript Five Hundred Card Game Open Misère Tutorial is shown below. The 500 card game of yesterday’s Just Javascript Five Hundred Card Game Emoji Entities Tutorial, and incarnation before it, hid from the players the chance to bid … Open Misère … but we … Continue reading →

Posted in Ajax, eLearning, Event-Driven Programming, Games, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Just Javascript Five Hundred Card Game Open Misère Tutorial

The 500 card game of yesterday’s Just Javascript Five Hundred Card Game Emoji Entities Tutorial, and incarnation before it, hid from the players the chance to bid … Open Misère … but we want to remedy this because … it is a fun “out there” addition to the 500 card game it can win the game there and then, worth 500 points to that player pairing that lose all ten tricks with the partner of the winning bidder openly displaying their cards to all players, and played by the winning bidder the bits and pieces to achieve this programmatically are there … … but, we are going to take this on gradually, our part one, today, fixing a couple of issues with remote email players using the PHP mail method, those being … add Open Misère successful bidder’s partner’s cards in a second table … if ((!in_bidding || in_kitty) && eval(” + omc) >= 0) { if ((” + hsuffs[eval(-1 + omc)]).replace(‘null’,”).indexOf(‘<table’) != -1 && eval(” + curplayer) != eval(” + omc)) { outdivhtml=outdivhtml.replace(‘</table>’, ‘</table><br><p>And here are the cards of the Open player ‘ + sef(emailsms[eval(-1 + omc)], eval(-1 + omc)) + ‘ …</p><br><table’ + hsuffs[eval(-1 + omc)].split(‘<table’)[1].split(‘</table>’)[0].replace(/\<tr\ id\=/g, ‘<tr style=display:none; id=’).replace(/SUBMIT/g,’button’).replace(/submit/g,’button’).replace(/\ href\=/g,’ data-href=’) + ‘</table></body>’); } else if ((” + hsuffs[eval(-1 + omc)]).replace(‘null’,”).indexOf(‘<table’) != -1) { outdivhtml=outdivhtml.replace(‘</table>’, ‘</table><br><p>And here are the cards of the Open player ‘ + sef(emailsms[eval(-1 + omc)], eval(-1 + omc)) + ‘ … ‘ + zsuffs[eval(-1 + omc)] + ‘</p></body>’); } } … within the Inline HTML email to other player emails … and … when it is the time for the Open Misère successful bidder’s partner to play their card, their email is BCC’ed to the Open Misère successful bidder’s email address Feel free to retry the improved 500 card game part of our changed cards_usefocus.html code behind the “Just Javascript” Memories Card Game or live run with single window (good for mobile) or default live run (for your platform, and if non-mobile it will try child popup windows). Try adding “.0” to number of card players to play (our hybrid) “500” card game, and optionally wait or immediately append a comma separated email/SMS address/number list for your “500 card game” players (who can affect the game remotely via email)! Previous relevant Just Javascript Five Hundred Card Game Emoji Entities Tutorial is shown below. We happened to open up a new email client application to the remote 500 card player emails of yesterday’s Just Javascript Five Hundred Card Game Internationalization Tutorial and, at least for our macOS Mail app, the suit and card emojis came up as gobbledegook in the body Inline HTML section of the the emails. This discovery, though offputting, also lead, by a few minutes ago (writing this blog post), to a two-pronged improvement to our 500 card game web application as per … the lack of clarity saw us relying … Continue reading →

Posted in Ajax, eLearning, Event-Driven Programming, Games, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Just Javascript Five Hundred Card Game Emoji Entities Tutorial

We happened to open up a new email client application to the remote 500 card player emails of yesterday’s Just Javascript Five Hundred Card Game Internationalization Tutorial and, at least for our macOS Mail app, the suit and card emojis came up as gobbledegook in the body Inline HTML section of the the emails. This discovery, though offputting, also lead, by a few minutes ago (writing this blog post), to a two-pronged improvement to our 500 card game web application as per … the lack of clarity saw us relying (on our non-mobile aspect to viewing) the HTML element title (hover over see blurb) content, and realizing that a full player card list as a title on their name textbox would be just peachy … var wsuffs=[]; function bStringfromCodePoint(jgf) { var stile=”, igf=0; for (var kgf=0; kgf<spcps.length; kgf++) { if ((” + spcps[kgf]).split(‘/’)[0] == (” + jgf)) { igf=kgf; } } stile=((” + spcps[eval(” + igf)]).split(‘.’)[0].slice(-3).substring(0,2).toLowerCase().replace(’00’,’Joker aka ‘).replace(’01’,’Ace of ‘).replace(’02’,’2 of ‘).replace(’03’,’3 of ‘).replace(’04’,’4 of ‘).replace(’05’,’5 of ‘).replace(’06’,’6 of ‘).replace(’07’,’7 of ‘).replace(’08’,’8 of ‘).replace(’09’,’9 of ‘).replace(’10’,’10 of ‘).replace(’11’,’Jack of ‘).replace(’12’,’Queen of ‘).replace(’13’,’King of ‘) + (” + spcps[eval(” + igf)]).split(‘.’)[0].slice(-1).replace(‘c’,’Club’).replace(‘d’,’Diamond’).replace(‘s’,’Spade’).replace(‘h’,’Heart’).replace(‘0′,’No Trump’) + ‘s’).toLowerCase(); return stile; } // Example call codeline … wsuffs[eval(-1 + eval(eval(ixc % nominal_numplayers) + 1))]+=’ ‘ + eval(eval(ixc % nominal_numplayers) + 1) + ‘.’ + Math.floor(eval(ixc + eval(” + nominal_numplayers)) / eval(” + nominal_numplayers)) + ‘:’ + bStringfromCodePoint(eval(spcps[kjn].split(‘/’)[0])); // Example of use piecing together remote 500 card player email … outdivhtml=outdivhtml.replace(‘</TR>’, ‘<td colspan=’ + twentythree + ‘></td></tr><tr><td colspan=10>500 Card Game Player’ + eval(” + bidplayer) + ‘ Name: <input title=”‘ + wsuffs[eval(-1 + bidplayer)].split(” + bidplayer + ‘.11’)[0] + ‘” type=text name=myname value=”‘ + pnames[eval(-1 + bidplayer)] + ‘”></input></td><td colspan=20 style=text-align:center;>… relevant to your cards below …</td></tr>’).replace(‘</thead>’,'</THEAD>’); the trial of one of the alternative emoji display mechanisms that isn’t String.fromCodePoint([HTML-decimal-entity]) ( ie. &#[HTML-decimal-entity]; ) … eg. Spades ♠ String.fromCodePoint(9824); alternative would be &#9824; … had us, amongst a few things, change … function nominalemojisuit(ptrumpsare) { if (ptrumpsare == ‘d’) { return ‘&#9830;&#65039;’; //String.fromCodePoint(9830,65039); // &#9830; &#65039; } else if (ptrumpsare == ‘h’) { return ‘&#10084;&#65039;’; //String.fromCodePoint(10084,65039); // &#10084; &#65039; } else if (ptrumpsare == ‘c’) { return ‘&#9827;’; //String.fromCodePoint(9827); // &#10084; &#65039; &#10084; &#65039; } else if (ptrumpsare == ‘s’) { return ‘&#9824;’; //String.fromCodePoint(9824); // &#10084; &#65039; &#10084; &#65039; } // &#57378; return ”; } … all fine and good, now, for macOS Mail app (email client), but, more importantly, it did not break with any of the previously working mail applications, making these changes. Yay!!!!! So please retry the improved 500 card game part of our changed cards_usefocus.html code behind the “Just Javascript” Memories Card Game or live run with single window (good for mobile) or default live run (for your platform, and if non-mobile it will try child popup windows). Try adding “.0” to number of card players to play (our hybrid) “500” card game, … Continue reading →

Posted in Ajax, eLearning, Event-Driven Programming, Games, Operating System, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Just Javascript Five Hundred Card Game Internationalization Tutorial

Continuing themes from yesterday’s Just Javascript Five Hundred Card Game Email Tutorial we’ve been shoring up aspects to the user experience for our 500 card game web application via … internationalization focus on increased use of … emojis (eg. suit emojis within Inline HTML Emails) … and along the way discovered flaws in our “follow the same suit as leading card” logic, now centred around … function threetoone(threeis) { var suitis=(” + threeis).slice(-1).toLowerCase(); var crdis=(” + threeis).substring(0,2); if (crdis == ’11’ && trumpsare != ‘0’) { if (trumpsare.replace(‘c’,’s’) == ‘s’ && suitis.replace(‘c’,’s’) == ‘s’ && suitis != trumpsare) { //alert(‘right bower played as ‘ + suitis.replace(‘c’,’S’).replace(‘s’,’C’).toLowerCase()); return suitis.replace(‘c’,’S’).replace(‘s’,’C’).toLowerCase(); } else if (trumpsare.replace(‘h’,’d’) == ‘d’ && suitis.replace(‘h’,’d’) == ‘d’ && suitis != trumpsare) { //alert(‘Right bower played as ‘ + suitis.replace(‘h’,’D’).replace(‘d’,’H’).toLowerCase()); return suitis.replace(‘h’,’D’).replace(‘d’,’H’).toLowerCase(); } } return suitis.toLowerCase().replace(‘0’, trumpsare); } function maybeno(xxcw) { var allowthrough=gallow, fnd=false, fnds=[], ifnds=0; csuffix=”; if (nogolist.indexOf(‘,’ + xxcw + ‘,’) != -1) { if (card_game.toLowerCase() == ‘500ish’) { console.log(‘oops’); } return ‘1234567’; } //alert(‘thishand.length=’ + thishand.length); if (thishand.length != 0 && card_game.toLowerCase() == ‘500ish’) { //alert(‘here’); //if (!allowthrough) { alert(‘RE ‘ + ysuffs[eval(-1 + eval(” + curplayer))] + ‘ … lead with ‘ + thishand[0].slice(-1).toLowerCase() + ‘ and you played ‘ + hands[eval(0 + xxcw)].slice(-1).toLowerCase()); } if (!allowthrough && threetoone(thishand[0].slice(-3).toLowerCase()) != threetoone(hands[eval(0 + xxcw)].slice(-3).toLowerCase())) { fnds=ysuffs[eval(-1 + eval(” + curplayer))].substring(1).split(‘ ‘); for (ifnds=0; ifnds<fnds.length; ifnds++) { if (fnds[ifnds].indexOf(‘,’) != -1) { //if joker and trumpsare is lead, relax //if right bower and trumpsare is lead, relax if (fnds[ifnds].toLowerCase().indexOf(threetoone(thishand[0].slice(-3).toLowerCase())) != -1) { fnd=true; } } } if (fnd) { if (eval(” + emailsms.length) >= eval(” + curplayer)) { if ((” + emailsms[eval(” + curplayer)]).trim() != ”) { csuffix=’ Will resend last email if you cancel this play.’; } } allowthrough=confirm(‘You could follow suit (where trumps are ‘ + trumpsare.replace(‘c’,’Club’).replace(‘d’,’Diamond’).replace(‘s’,’Spade’).replace(‘h’,’Heart’).replace(‘0′,’No Trump’) + ‘s’ + ‘), Player ‘ + clong(curplayer) + ‘! Allow through anyway?’ + csuffix); if (!allowthrough) { if (1 == 11) { alert(‘False’); } if (eval(” + emailsms.length) >= eval(” + curplayer)) { retcom(pmesg, pretv); } return ‘1234568’; } else { if (1 == 11) { alert(‘True’); } } } } } return xxcw; } … as well as non-mobile users being able to hover over bidding buttons to discover what their team scores with that bid, and the background image text up the top left mentioning “Bid” during any bidding phase and “Click (via email) away …” or “Click (via SMS) away …” for remote players, back for the hoster’s web application window, during the “playing out of the tricks” phase of the 500 card game, hopefully establishing a means by which the hoster can know what is, or is not and should be, going on with the hoster’s 500 card game, and so enabling informed email communication to get the games back on the rails, perhaps. Please retry the improved 500 card game part of … Continue reading →

Posted in Ajax, eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Just Javascript Five Hundred Card Game Email Tutorial

In a blog post some time before yesterday’s Just Javascript Five Hundred Card Game CC Tutorial we talked of “order” when we presented Just Javascript Five Hundred Card Game Order Tutorial. Don’t know about you, but I find the combination of … form … and … table … based Inline HTML in an email, asking for interactive input, “orderly”. Probably we normally think of data to append to an established “table” element via the addition of a new row (“tr” element) or cell (within a row via a “td” or “th” element). Within a “table” element though, you can think of “partitions” in the form of … thead … and … tbody … which have that synergy with a webpage’s “head” and “body” elements, the theme of the current blog posting thread being to do away with the need for a “body” element (except for our Inline HTML Emails (which can’t really do anything much without their “body” elements)). We do a bit of uppercase/lowercase work with the end of “thead” element (ie. </THEAD>) to leave our email Inline HTML “table” “thead” elements blank for … 500 card game “bidding” emails … and for … 500 card game “kitty/bidding” emails … but then start to fill in the “thead” element for the “playing out of the tricks” emails, adding today’s work, better card game status information, added to the top of the tabular information presented. Rather than fret about adding to the top, we just slot into the unallocated “thead” slot, for these scenarios, as per … function tabord(indivhtml) { var ilook=0, jlook=1, klook=0, cbidfound=’SUBMIT’, tdyellow=”; var slookfor=[‘ data-suit=s’, ‘ data-suit=c’, ‘ data-suit=d’, ‘ data-suit=h’]; var slooks=[]; var outdivhtml='<br><style> isyellow { background-color:yellow; </style><table border=2><thead></thead><tbody></tbody></table>’ if (in_bidding) { twentythree=30; //outdivhtml=outdivhtml.replace(‘</tbody>’, ‘<tr><td>Bidding<br>Current Bid: ‘ + cbid + ‘<td><input type=SUBMIT name=myanswer value=”pass “></input></td></TR></tbody>’); if (in_kitty) { console.log(‘tds_kitty=’ + tds_kitty); outdivhtml=outdivhtml.replace(‘</tbody>’, tds_kitty + ‘</tbody>’); //.replace(‘</thead>’,'</THEAD>’); outdivhtml=outdivhtml.replace(‘</tbody>’, ‘<tr><td>Bidding<br>Your Current Bid: None<td><input type=’ + cbidfound + ‘ name=myanswer value=”pass “></input></td></TR></tbody>’); } else { outdivhtml=outdivhtml.replace(‘</tbody>’, ‘<tr><td>Bidding<br>Current Bid: None<td><input type=’ + cbidfound + ‘ name=myanswer value=”pass “></input></td></TR></tbody>’); } if (cbid.toLowerCase().trim().replace(‘pass’,’none’).replace(‘none’,”) != ”) { cbidfound=’button’; } twentythree–; twentythree–; for (klook=0; klook<bids.length; klook++) { if (bids[klook].toLowerCase().trim() == cbid.toLowerCase().trim()) { tdyellow=’ title=”Current leading bid by Player ‘ + cbidby + ‘” class=isyellow’; } if (bids[klook].indexOf(‘open’) == 0) { outdivhtml=outdivhtml.replace(‘</TR>’, ‘<td’ + tdyellow + ‘><input style=display:none; type=’ + cbidfound + ‘ name=myanswer value=’ + bids[klook] + ‘></input></td></TR>’); } else { outdivhtml=outdivhtml.replace(‘</TR>’, ‘<td’ + tdyellow + ‘><input type=’ + cbidfound + ‘ name=myanswer value=”‘ + bids[klook] + ‘ “></input></td></TR>’); } if (bids[klook].toLowerCase().trim() == cbid.toLowerCase().trim()) { cbidfound=’SUBMIT’; } twentythree–; tdyellow=”; } //outdivhtml=outdivhtml.replace(‘</TR>’, ‘<td colspan=’ + twentythree + ‘></td></tr><tr><td colspan=10>500 Card Game Player’ + eval(” + bidplayer) + ‘ Name: <input type=text name=myname value=”‘ + pnames[eval(-1 + bidplayer)] + ‘”></input></td><td colspan=20 style=text-align:center;>… relevant to your cards below …</td></tr>’ + tds_kitty).replace(‘</thead>’,'</THEAD>’); outdivhtml=outdivhtml.replace(‘</TR>’, ‘<td colspan=’ + twentythree + ‘></td></tr><tr><td colspan=10>500 Card Game Player’ + eval(” + bidplayer) … Continue reading →

Posted in Ajax, eLearning, Games, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Just Javascript Five Hundred Card Game CC Tutorial

On top of yesterday’s Just Javascript Five Hundred Card Game Names Tutorial “names for numbers” work, today we have two themes to the work … shore up that offer on the “500 card game” first Javascript prompt window to enter email/SMS addresses/numbers straight away, meaning no more Javascript prompt windows appear until the end of the game if players follow suit … and … should the host of the “500 card game” wait to enter email/SMS addresses/numbers later they can then enter comma separated email/SMS address/number lists which get recognised as any 3 combinations of … email address (and you can specify a name for those all lowercase PHP mail Inline HTML Email scenarios) and mixed case for mailto: emails for the To: recipient email address for a CC: recipient (mixed case for mailto: emails) email address for a BCC: recipient (mixed case for mailto: emails) SMS number … which we facilitated among the changed “fes()” function we show below, along with its buddies … function sff(ines, nines) { // expand out Player n var outes=”, thisp=0; ines=ines.replace(/Player\ Player\ /g,’Player ‘); if (ines.indexOf(‘Click away Player ‘) != -1) { var withins=ines.split(‘Click away Player ‘); outes=withins[0]; for (var igfd=1; igfd<withins.length; igfd++) { if ((” + pnames[eval(-1 + eval(” + nines))]) == ‘Player ‘ + nines) { //alert(‘Here’); outes+=(‘Click away Player ‘ + withins[igfd]); } else { //alert(‘here’); outes+=(‘Click away Player ‘ + withins[igfd]).replace(‘Click away Player ‘, ‘Click away ‘ + pnames[eval(-1 + eval(” + nines))] + ‘ ‘); } } return outes; } return ines; } function efs(ines, nines) { // expand out Player n var outes=”, thisp=0; //alert(‘In ines=’ + ines + ‘ pnames[0]=’ + pnames[0]); ines=ines.replace(/Player\ Player\ /g,’Player ‘); if (ines.indexOf(‘Player ‘) != -1) { var withins=ines.split(‘Player ‘); outes=withins[0]; for (var igfd=1; igfd<withins.length; igfd++) { yhisp=withins[igfd].split(‘[‘)[0].split(‘)’)[0].split(‘,’)[0].split(‘?’)[0].split(‘”‘)[0].split(“‘”)[0].split(‘<‘)[0].split(‘ ‘)[0]; console.log(‘yhisp=’ + yhisp); if ((” + yhisp + ‘x’).substring(0,1) < ‘0’ || (” + yhisp + ‘x’).substring(0,1) > ‘9’) { outes+=’Player ‘ + withins[igfd]; } else if (eval(” + pnames.length) > eval(-1 + eval(” + yhisp))) { //alert(‘yhisp=’ + yhisp + ‘ is it in ‘ + ‘Player ‘ + withins[igfd] + ‘ … ‘ + pnames[eval(-1 + eval(” + yhisp))] + ‘ += ‘ + (‘Player ‘ + withins[igfd]).replace(‘Player ‘ + yhisp, pnames[eval(-1 + eval(” + yhisp))]) + ‘ ines=’ + ines + ‘ becomes ‘ + ‘outes=’ + outes + ‘ so far’); outes+=(‘Player ‘ + withins[igfd]).replace(‘Player ‘ + yhisp, pnames[eval(-1 + eval(” + yhisp))]); } else { outes+=’Player ‘ + withins[igfd]; } } //alert(‘Out ines=’ + outes.replace(‘500 Card Game Player’, ‘500 Card Game Player ‘)); return outes.replace(‘500 Card Game Player’, ‘500 Card Game Player ‘); } return ines; } function esf(ines, nines) { // if specified name, return that instead if (eval(” + pnames.length) > eval(0 + Math.max(eval(” + nines),eval(” + nines)))) { return pnames[eval(0 + Math.max(eval(” + nines),eval(” + nines)))]; } return ines; } function fesh(xines) { if … Continue reading →

Posted in Ajax, eLearning, Event-Driven Programming, Games, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Just Javascript Five Hundred Card Game Names Tutorial

Onto yesterday’s Just Javascript Five Hundred Card Game Rendering Timing Tutorial, being our web application is now dealing with collaboration and teams, wouldn’t it be good to provide a mechanism to turn those boring … Player 1,Player 2,Player 3,Player 4 … number feeling default labels for players be able to be turned into names? We accept, now, email definitions such as … Robert James Metcalfe[rmetcalfe15@gmail.com] … to facilitate this additional user experience improvement. It needed all these new Javascript called functions … function sff(ines, nines) { // expand out Player n var outes=”, thisp=0; ines=ines.replace(/Player\ Player\ /g,’Player ‘); if (ines.indexOf(‘Click away Player ‘) != -1) { var withins=ines.split(‘Click away Player ‘); outes=withins[0]; for (var igfd=1; igfd<withins.length; igfd++) { if ((” + pnames[eval(-1 + eval(” + nines))]) == ‘Player ‘ + nines) { //alert(‘Here’); outes+=(‘Click away Player ‘ + withins[igfd]); } else { //alert(‘here’); outes+=(‘Click away Player ‘ + withins[igfd]).replace(‘Click away Player ‘, ‘Click away ‘ + pnames[eval(-1 + eval(” + nines))] + ‘ ‘); } } return outes; } return ines; } function efs(ines, nines) { // expand out Player n var outes=”, thisp=0; ines=ines.replace(/Player\ Player\ /g,’Player ‘); if (ines.indexOf(‘Player ‘) != -1) { var withins=ines.split(‘Player ‘); outes=withins[0]; for (var igfd=1; igfd<withins.length; igfd++) { yhisp=withins[igfd].split(‘[‘)[0].split(‘)’)[0].split(‘,’)[0].split(‘?’)[0].split(‘”‘)[0].split(“‘”)[0].split(‘<‘)[0].split(‘ ‘)[0]; console.log(‘yhisp=’ + yhisp); if ((” + yhisp + ‘ ‘).substring(0,1) < ‘0’ || (” + yhisp + ‘ ‘).substring(0,1) > ‘9’) { outes+=’Player ‘ + withins[igfd]; } else if (eval(” + pnames.length) > eval(-1 + eval(” + yhisp))) { //alert(‘yhisp=’ + yhisp + ‘ is it in ‘ + ‘Player ‘ + withins[igfd] + ‘ … ‘ + pnames[eval(-1 + eval(” + yhisp))] + ‘ += ‘ + (‘Player ‘ + withins[igfd]).replace(‘Player ‘ + yhisp, pnames[eval(-1 + eval(” + yhisp))]) + ‘ ines=’ + ines + ‘ becomes ‘ + ‘outes=’ + outes + ‘ so far’); outes+=(‘Player ‘ + withins[igfd]).replace(‘Player ‘ + yhisp, pnames[eval(-1 + eval(” + yhisp))]); } else { outes+=’Player ‘ + withins[igfd]; } } return outes.replace(‘500 Card Game Player’, ‘500 Card Game Player ‘); } return ines; } function esf(ines, nines) { // if specified name, return that instead if (eval(” + pnames.length) > eval(0 + Math.max(eval(” + nines),eval(” + nines)))) { return pnames[eval(0 + Math.max(eval(” + nines),eval(” + nines)))]; } return ines; } function fes(ines, nines) { // strip Name Of[email@at] to email@at var prevcsuff=”; var hjg=”; var ipl=0; var nameas=ines.split(‘[‘); if (eval(” + nameas.length) == 2) { if (nameas[1].indexOf(‘]’) != -1) { while (eval(” + pnames.length) < eval(” + nines)) { pnames.push(‘Player ‘ + eval(1 + pnames.length)); } if ((” + nines).indexOf(‘-‘) == -1) { while (eval(” + pnames.length) < eval(” + nines)) { pnames.push(‘Player ‘ + eval(1 + pnames.length)); } } pnames[eval(0 + Math.max(eval(” + nines),eval(” + nines)))]=nameas[0]; ines=ines.replace(nameas[0] + ‘[‘,”).replace(‘]’,”); prevcsuff=csuff; csuff=”; hjg=” + curplayer; for (ipl=0; ipl<hjg.length; ipl++) { csuff+=String.fromCodePoint(eval(8320 + eval(eval(” + hjg.substring(ipl,eval(1 + eval(” + ipl))).charCodeAt(0)) – 48))); } defstyle=defstylereplace(‘ ‘ + prevcsuff … Continue reading →

Posted in Ajax, eLearning, Event-Driven Programming, Games, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Just Javascript Five Hundred Card Game Rendering Timing Tutorial

Every now and then, and usually involving the timing of a Javascript prompt or confirm or alert popup window, we are caught out by that tiny snippet of time it takes the web browser to complete a rendering task. If that rendering task has not completed ahead of the modal Javascript popup windows it is not always “mission critical” unworkable for the user, as with our current project where we have put up with the annoyance for more than a week now. The scenario of the issue is … In the 500 card game (with all players non-remote (ie. presumably all using the one device)) on, say, Player 1, clicking their first card, and in the interests of allowing players to only see their own cards, before our fix, the prompt window prompting Player 2 to tell others to turn away because the next prompt window display Player 2 cards, that Player 1 click turn over of card webpage rendering had not finished. … but better would it be if it was, because then Player 1 involvement would be done and dusted, and would not be a concern going forward with Player 2 activities. Believe it or not, on occasions all that is needed here to address this annoyance is a fifth of a second of delay, as per … var passcnt=0; var gwh=”; function myalertmc(wh) { // new myalertmc() function … gwh=wh; if (passcnt != 0) { gmyalertmc(); // … sometimes if okay without delay … } else { setTimeout(gmyalertmc, 200); // … but sometimes a very short delay is enough time for webpage rendering to complete … } } function gmyalertmc() { // (wh) … mainly just the old myalertmc() function … var wh=”; if (gwh != ”) { wh=gwh; gwh=”; } // Rest of old myalertmc() function code follows, where a Javascript prompt popup window happens … } We hope you can see an improvement on yesterday’s Just Javascript Five Hundred Card Game Continuous Scoring Tutorial with our changed cards_usefocus.html code behind the “Just Javascript” Memories Card Game or live run with single window (good for mobile) or default live run (for your platform, and if non-mobile it will try child popup windows). Try adding “.0” to number of card players to play (our hybrid) “500” card game, and optionally wait or immediately append a comma separated email/SMS address/number list for your “500 card game” players (who can affect the game remotely via email)! Previous relevant Just Javascript Five Hundred Card Game Continuous Scoring Tutorial is shown below. Up until yesterday’s Just Javascript Five Hundred Card Game Kitty Dropdown Tutorial any “500 card game” web application work was self contained within a single execution of a single web page. But with a 4 player 500 card game, it is usually the case that a game spans several shuffle and deal sets of 10 trick “plays” for a … Continue reading →

Posted in Ajax, eLearning, Event-Driven Programming, Games, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment