demo of Tuxedo Script, 99 bottles of beer, shortened
A Pen by Mink CBOS - Ephellon Dantzler on CodePen.
<body> | |
<h1>99 bottles of beer on the wall, 99 bottles of beer, you take one down, pass it around, 98 bottles of beer on the wall</h1> | |
<div id=r> | |
⋮<br> | |
</div> | |
<hr> | |
<h3>TuxedoScript:</h3> | |
<!-- below is the raw TuxedoScript, it will be parsed and show the JS --> | |
<code type=text/tux-script eval=! html-editor=! clean=! wordy=!> | |
#*# Tuxedo Documentation [JavaDoc] | |
* TuxedoScript demos. (9)9 bottles of beer, basics, and syntax | |
* This is to show how TuxedoScript (TS) can be used | |
* @aut: Ephellon Dantzler | |
* A.K.A.: "Mink CBOS" | |
* @tie: 23:02 CDT -06:00 | |
* @dat: 09/16/2015 | |
* @lie: MIT | |
* actually licensed under the current "CodePen" license | |
* @url: http://codepen.io/Ephellon/pen/avORxY | |
* current location | |
* @ver: none | |
* This has no version, nor version information | |
## | |
#e = $doc.$id("r"). // declare e as the element with id=r | |
#b = $doc.body. // declare b as the body | |
for x,9,-1,-1 { | |
// for(var x=9. x!=-1. x+=-1) | |
switch x | |
// switch(x) | |
@2: | |
// case 2 | |
e.$html += '2 bottles of beer on the wall, 2 bottles of beer, you take one down, pass it around, 1 bottle of beer on the wall<br>'. | |
break. | |
@1: | |
e.$html += '1 bottle of beer on the wall, 1 bottle of beer, you take one down, pass it around, 0 bottles of beer on the wall<br>'. | |
break. | |
@0: | |
e.$html += '0 bottles of beer on the wall, 0 bottles of beer, you go to the store, you buy some more, 99 bottles of beer on the wall<br>'. | |
break. | |
@def: | |
e.$html += x + ' bottles of beer on the wall, ' + x + ' bottles of beer, you take one down, pass it around, ' + (x-1) + ' bottles of beer on the wall<br>'. | |
} | |
} | |
// extra | |
if b.style { | |
// if(window == this) | |
b.style.background = "#1d1f20". | |
b.style.color = "#efc371". | |
}{ | |
// else | |
$con.log("Huge problem here") | |
} // console.log | |
$hello hi { | |
// function hello(hi) | |
#hi = hi || "world". | |
% "Hello " + hi. | |
} | |
// return "Hello " + hi | |
$#.freeze(b). // Object.freeze | |
$con.log($of b). // typeof b | |
</code> | |
<!-- import TuxedoScript.js --> | |
<script src="http://codepen.io/Ephellon/pen/EVxVaJ.js"></script> | |
</body> |
/** | |
* Nothing here | |
**/ |
/** | |
* Code styling | |
**/ | |
body { | |
font-family: monospace, arial; | |
} |
demo of Tuxedo Script, 99 bottles of beer, shortened
A Pen by Mink CBOS - Ephellon Dantzler on CodePen.