Tag Archives: cell

Just Javascript Five Hundred Card Game Early Exit Tutorial

Onto yesterday’s Just Javascript Five Hundred Card Game Open Misère Progress Bar Tutorial progress, barring setbacks … tee hee … we want to further progress towards a mode of use that goes … 500 card game … like “04.0,Robert Metcalfe[rmetcalfe15@gmail.com;rmetcalfe41@gmail.com], RMet[rmetcalfe15@gmail.com], RM[rmetcalfe41@gmail.com], R.M[rmetcalfe41@gmail.com] ” entered (deliberate space at end) at first prompt … then that’s it, the rest (of the 500 card game) able to be transacted via email (perhaps out and about), with the hoster’s originating webpage displaying the results of a round of tricks and updating scores … the deliberate space allowing cards through that do not follow suit with no quibbling and that hoster having a fully lowercase email address (as do the other players) … allows us to head towards this “only email interaction” mode of play concept. We have not tested screens falling asleep etcetera etcetera etcetera but we are keen to see how far the concept can go. Just as Kenny Rogers wants to … Know when to fold ’em … the work today on top of parsing the host’s more complex entries at that first Javascript prompt window, is to deal with the idea of an Early Exit from a bidded on 500 round when any of … Misère bidder wins a trick ahead of the 10 possible tricks that can be played non-Misère bidder wins the requisite number of tricks ahead of the 10 possible tricks that can be played non-Misère bidder loses the requisite number of tricks ahead of the 10 possible tricks that can be played … where we now step in and call off proceedings as this happens, perhaps. Continuing on as still “Just Javascript” (ie. no “body” element definition) try the 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 Progress Bar Tutorial is shown below. Even with yesterday’s Just Javascript Five Hundred Card Game Open Misère All Local Tutorial, it may not seem like it, but we have been beavering

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

Just Javascript Five Hundred Card Game Open Misère Progress Bar Tutorial

Even with yesterday’s Just Javascript Five Hundred Card Game Open Misère All Local Tutorial, it may not seem like it, but we have been beavering away keeping the 500 card game “status area” giving relevant information. Today we load it up even more as a dual purpose … background (svg) “rect” element semi-transparent background to 500 card game status area progress bars for Player 1/3 scoring and Player 2/4 scoring … displaying during the bidding and kitty phase of the game … and then … background (svg) “rect” element semi-transparent background to 500 card game status area progress bar for leading bid trick round scoring relative to final bid made … displaying during card play phase of the game … as per (the multi-purpose) … function progressbar(inoutss) { var outss=inoutss; if (outss == ”) { outss=scoresuffix; } var totball=0; var totnball=0; if (card_game == ‘500ISH’) { // && cbid.replace(‘None’,’pass’) != ‘pass’) { var prevbb=bbtextb; var tonget=0; var ssare=outss.replace(/\-/g,”).split(‘,’); var ssallare=outss.split(‘,’); var abbtextb=bbtextb; if (!in_bidding && !in_kitty) { var tott=eval(Math.floor(eval(ssare[0])) + Math.floor(eval(ssare[1])) + Math.floor(eval(ssare[2])) + Math.floor(eval(ssare[3]))); var totb=0; var totnb=0; var toget=-10; if ((” + cbid).substring(0,1) == ‘6’) { toget=6; tonget=4; } if ((” + cbid).substring(0,1) == ‘7’) { toget=7; tonget=3; } if ((” + cbid).substring(0,1) == ‘8’) { toget=8; tonget=2; } if ((” + cbid).substring(0,1) == ‘9’) { toget=9; tonget=1; } if ((” + cbid).substring(0,2) == ’10’) { toget=10; tonget=0; } if ((” + cbidby).replace(‘3′,’1’) == ‘1’) { totb=eval(Math.floor(eval(ssare[0])) + Math.floor(eval(ssare[2]))); totnb=eval(Math.floor(eval(ssare[1])) + Math.floor(eval(ssare[3]))); abbtextb=”<rect x=’0′ y=’0′ width=’1400′ height=’48’ fill=’rgba(255,0,0,0.3)’ />”; } else { totnb=eval(Math.floor(eval(ssare[0])) + Math.floor(eval(ssare[2]))); totb=eval(Math.floor(eval(ssare[1])) + Math.floor(eval(ssare[3]))); abbtextb=”<rect x=’0′ y=’0′ width=’1400′ height=’48’ fill=’rgba(0,255,0,0.3)’ />”; } if ((” + toget) == ‘-10’) { if (eval(” + totb) > 0) { bbtextb=abbtextb.replace(” width='” + abbtextb.split(” width='”)[1].split(“‘”)[0] + “‘”, ” width=’0′”); //if (defstyle.indexOf(prevbb) == -1) { alert(‘Oops’); } defstyle=defstyle.replace(prevbb, bbtextb); } else { bbtextb=abbtextb.replace(” width='” + abbtextb.split(” width='”)[1].split(“‘”)[0] + “‘”, ” width='” + (” + eval(-1400 * eval(totnb) / eval(toget))).split(‘.’)[0] + “‘”); //if (defstyle.indexOf(prevbb) == -1) { alert(‘OOps’); } defstyle=defstyle.replace(prevbb, bbtextb); } } else { if (eval(” + totnb) > eval(” + tonget)) { bbtextb=abbtextb.replace(” width='” + abbtextb.split(” width='”)[1].split(“‘”)[0] + “‘”, ” width=’0′”); //if (defstyle.indexOf(prevbb) == -1) { alert(‘OoPs’); } defstyle=defstyle.replace(prevbb, bbtextb); } else { bbtextb=abbtextb.replace(” width='” + abbtextb.split(” width='”)[1].split(“‘”)[0] + “‘”, ” width='” + (” + eval(1400 * eval(totb) / eval(toget))).split(‘.’)[0] + “‘”); //if (defstyle.indexOf(prevbb) == -1) { alert(‘OopS’); } defstyle=defstyle.replace(prevbb, bbtextb); } } } else { // progress

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

Just Javascript Five Hundred Card Game Open Misère All Local Tutorial

You may be new to this “500 card game” web application work of yesterday’s Just Javascript Five Hundred Card Game Open Misère Wording Tutorial, in which case it may be that we need to reiterate information about the game’s workings … game can be played by 4 players hovering around the same device … non-remote or “All Local” (as in today’s blog posting title) … or … game can be played by a single hoster running this web application, hosting remote (via email or SMS) linked players and perhaps some “All Local” ones As the project continues we’ve found the logic of the first “All Local” mode lagging behind, because it is harder. Huh?! Well, it is harder because of the bother we need to take to try to allow players to hide their cards from other players, given some “looking away” co-operation from the players when asked to. And so, just because in the last couple of days we made progress with Open Misère logic for remote player scenarios, alas, doesn’t mean we’ve had the “All Local” equivalent logic working as well. Today we try evening up that score. It was hard to take this code line being important in making that happen … for (var ibidis=0; ibidis<bids.length; ibidis++) { if ((” + cfm).toLowerCase().indexOf(‘pass’) == 0) { isbid=true; gd=(” + dis); sentanswer=’pass ‘; console.log(‘3:sentclick() and ma=’ + ma); cfm=”; //null; sentclick(); } else if ((” + cfm + ‘ ‘).substring(0,3).toLowerCase() == (bids[ibidis] + ‘ ‘).substring(0,3).toLowerCase()) { isbid=true; gd=(” + dis); sentanswer=bids[ibidis] + ‘ ‘; console.log(‘4:sentclick()’); sentclick(); } } … we found via “console.log” web inspector tracking down. We suspect, but did not research, that the reason “passcnt” went weird for “All Local” scenarios was as a result of some setTimeout logic self-incrementing “passcnt” programmatically, meaning the first pass bid (rather than the third, which is better) was setting off the Kitty logic ahead of time. Fixed now though! The “sss” variable emoji logic was also causing trouble for Open Misère status content fixed via … if (cbid.slice(-1).toLowerCase().replace(‘h’,’d’) == ‘d’) { sss=’ leading ‘ + cbidby + ‘ bid ‘ + cbid + ‘ ‘ + emojisuit() + ‘ ‘; } else { sss=’ leading ‘ + cbidby + ‘ bid ‘ + cbid + ‘ ‘ + emojisuit(); } sss=sss.replace(‘&#232;’, String.fromCodePoint(232)).replace(‘open_’, ‘open ‘).replace(‘&#232;’, String.fromCodePoint(232)).replace(‘open_’, ‘open ‘); With Open Misère in All Local mode of use logic we show all

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

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

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

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),

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

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’

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