Skip to content

Instantly share code, notes, and snippets.

@Ephellon
Created October 15, 2015 22:48
Show Gist options
  • Save Ephellon/5f7701ceecb511bcb1f6 to your computer and use it in GitHub Desktop.
Save Ephellon/5f7701ceecb511bcb1f6 to your computer and use it in GitHub Desktop.
Tuxedo Script - demo
<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>
&#8942;<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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment