In order to take that further genericization step onto the achievements of yesterdayโs Rainbow Games Genericization Tutorial to get onto (the mathematics Induction principle inspired) โฆ
- prove for the first case
- prove for the second case
- prove for the nth case
โฆ we had a choice of โฆ
- continue on (with) the HTML code creation of new โhardcodedโ arrays (managed by Javascript eval abstractional approach) โฆ or โbite the bulletโ and โฆ
- try to work out a generic โemoji lookerer uppererโ arrangement
Guess you can tell we opted for the latter, huh?! We started the investigation of this by examining our three favourite emoji informational websites, namely โฆ
โฆ and were a bit surprised that we could not quite swing a generic method to glean the information, so donโt know whether our new โplayerโ is โRingo Starrโ or not, but can tell you this, โits beat is much better than its biteโ โฆ chortle, chortle โฆ
Emoji Terra performs similar functionality as Iemoji but has a permalink organization more friendly to an โemoji search via emoji titleโ query, and that suits our purposes today, so, thanks a lot. Without this query by โemoji titleโ possibility weโd have been forced to adopt more of those โhardcodedโ arrays, which would have been alright, but this second approach opens the door to โsportโ events in โThe Rainbow Gamesโ web application using emojis of the future (ie. they havenโt been invented yet).
How to work the interfacing to Emoji Terra?
- good olโ PHP serverside language
- good olโ PHPโs file_get_contents (supplemented by)
- good newish โPHP Source File as the Database Sourceโ weโve talked about in the past with PHP Require Database Primer Tutorial and Signature Signature PHP Tutorial whereby the PHP Source File updates itself with web application data
This new PHP emoji_lookupphp treats the โprove for the nth caseโ sports as ones to โฆ
- look up the emoji information for (in the order โPHP Source File as the Database Sourceโ then try file_get_contents of Emoji Terra lookup), and โฆ
- read the HTML partner source code live
runโs underlying HTML and Javascript and CSS emoji_walk_animation
htm (which changed in thisway)
- amend that HTML source to supplant the โSprintโ default sport for this new nominated sport โฆ trying not to fall over laughing at some of the new sports we present (inspired by a visit to Emoji Terra search)
- write out that amended HTML code as the web page (the beauty of a serverside language like PHP)
The more detailed specifics of the file_get_contents of Emoji Terra lookup above are โฆ
- build up a URL starting with HTTP://emojiterra.com/ โฆ then โฆ
- in emojiland arrangements there are two genders (as our prefixes if you will) โฆ woman- and man-
- then add on a โmiddleโ sport descriptor (eg. biking)
- in emojiland emoticonland arrangements there are five descriptors (as our suffixes if you will) โฆ -dark-skin-tone, -medium-dark-skin-tone, -medium-skin-tone, -medium-light-skin-tone, -light-skin-tone
- for that set of 2x1x5=10 URLs glean what โHTML decโ (HTML Entity) information you can glean via the file_get_contents call of the Emoji Terra URLs described above (eg. Emoji: Woman Biking: Dark Skin Tone) โฆ built into a Javascript array string to โplug intoโ the previously read HTML partner source code, and amended to output as the web page the user sees
Sports of the future in emojiland? Just ask for the equivalent of biking (above) off the user via a Javascript prompt window (on the proviso you read Conditional Alternative to Javascript Popup Windows in iOS Tutorial first please).
Previous relevant Rainbow Games Genericization Tutorial is shown below.
What would help genericize the recent Rainbow Games Double Transformation Tutorial โRainbow Gamesโ web application? How about introducing another sport?
Again, in honour of โonions of the 4th dimensionโ approaches, we mainly, turn to the power of Javascriptโs eval methodology to achieve this abstracted feeling to our web application. Today, with this, we go two thirds of the way along the โMathematical Inductionโ approach โฆ
- prove for the first case
- prove for the second case
- prove for the nth case
How does this use of Javascript eval manifest itself in this way?
- there are two arrays that work with the โcontentโ of our โRainbow Gamesโ sport(s) (well, at least, the first โsprint runningโ sport) called emoticons[] and choices[]
- wherever we find references in the code to either of these two arrays we start to involve the global variable verbsuffix โฆ
var verb='Sprint';
var verbs=['Sprint','Row'];
var anotherverb='run';
var verbsuffix='';
โฆ in altered ways like โฆ
function plus(ih,ihep) {
var outihep=ihep;
if (eval("emoticons" + verbsuffix + "[" + ih + "]").indexOf('<p>') != -1) {
outihep += ' (' + eval("emoticons" + verbsuffix + "[" + ih + "]").split('<p>')[1].split('<')[0] + ')';
}
return outihep;
}
โฆ in that abstracted way โฆ noting that sometimes you donโt need the โeval()โ encasings โฆ - and so, working through the code this way it just falls to the coder to define new members for all the arrays for all the new sports (ours is โrowingโ today), some of those new arrays (like for rowing are emoticonsrowing[] and choicesrowing[]) to involve โฆ
- looking up emoji definitions from โฆ
โฆ not forgetting to โฆ
- make sure the event logics work for multiple sport scenarios โฆ but mostly they do by sticking to the principles above โฆ especially for the โฆ
- new HTML select (dropdown) element allows the user to pick a sport
Remaining a work in progress, you can try out our liverun link that has underlying HTML and Javascript and CSS emoji_walk_animation
htm, and which changed in thisway regarding todayโs genericization work. We hope it gives you food for thought.
Previous relevant Rainbow Games Double Transformation Tutorial is shown below.
We were on the โroad to personalizationโ for the web application game we started with yesterdayโs Rainbow Games Primer Tutorial when โan old chestnutโ came up again. Itโs happened before, the desire to โdouble transformโ in CSS came about from our emoji โฆ
โฆ table cell mirroring styling as per โฆ
<style>
* { overflow-x: visible; }
select { font-size: 36px; }
td.runner { width: 50px; word-wrap: break-word; font-size: 36px;
transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform: scale(-1, 1);
} //

tr { max-height: 40px; }
</style>
โฆ necessary to make our running emojis run from left to right (that, alas, also transformed any accompanying โฆ
Florence |
โฆ name), was added to in this double transformational clause to prove what this wonderful web page advice had to say. In other words, a โdouble transformโ CSS styling scenario like the one below โฆ
<style>
* { overflow-x: visible; }
select { font-size: 36px; }
td.runner { width: 50px; word-wrap: break-word; font-size: 36px;
transform: scale(-1, 1); -o-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -webkit-transform: scale(-1, 1);
}
tr { max-height: 40px; }
p {
display: block;
font-size: 12px;
-webkit-transform: matrix(-1, 0, 0, 1, 0, 0);
-moz-transform: matrix(-1, 0, 0, 1, 0, 0);
-o-transform: matrix(-1, 0, 0, 1, 0, 0);
transform: matrix(-1, 0, 0, 1, 0, 0);
} //
Florence
</style>
โฆ works as a โdouble transformโ to first โฆ
- mirror (image) flip the table cell (td) emoji data โฆ but us appending some โRunner Nameโ textual data underneath also, annoyingly, got flipped until โฆ
- within that (same) table cell (td) element and after the emoji data we append an HTML p(aragraph) element to both โฆ
- introduce a new HTML element type into the (CSS styling) mix โฆ and to โฆ
- introduce a new CSS transformation type, the matrix โฆ perhaps either or both new parts to the problem critical to its success when, believe me, lots of other approaches donโt work
โฆ to personalize the โrunnersโ and โusersโ, optionally, โinto the gameโ, by allowing the โuserโ to name their โrunnersโ and allow for a โrunner energyโ setting be a bit randomized, to add for some other interest โvarietyโ to the gameโs workings. So, still a work in progress that you can try out at our liverun link that has underlying HTML and Javascript and CSS emoji_walk_animation
html, and which changed in thisway regarding todayโs work.
Previous relevant Rainbow Games Primer Tutorial is shown below.
Itโs been a while since weโve written any conventional HTML and Javascript and CSS game. Todayโs game uses the โemoticonโ section of the Emoji character set, defaulting so far, to the โrunning womanโ emoji featuring in Compound Emoji WordPress Usage Tutorial.
Itโs the early days of our โRainbow Gamesโ web application, and weโre starting with the animation featuring horizontal hashtag navigation techniques for a running race start to our game. Where it finishes? Hard to say! Today, weโve looked at โsplitsโ and a finish line.
You can try out our burgeoning liverun game concept link that has underlying HTML and Javascript and CSS emoji_walk_animation
html.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.