1
+ /* TuxedoScript 12.5.1
2
+ @aut: Ephellon Dantzler
3
+ @dat: Tue Sept 8, 2015
4
+ @tie: 23:51 CST -06:00
5
+ @lie: "Free for use, as long as my name, CoffeeScript, Python, and ECMA are mentioned"
6
+ */
7
+ ##!, strict mode required for advanced features
8
+ ## Coffee Script-Like Examples, see coffeescript.org
9
+
10
+ ## Extendable features
11
+ ## +advance
12
+ ## +eval
13
+ ## +js-editor
14
+ ## +legacy
15
+ ## +math
16
+ ## +wordy
17
+ ## -hide
18
+ ## -html-editor
19
+ ## -ugly
20
+
21
+ ## Assignment
22
+ #number = 42
23
+ #opposite = true
24
+ 3.14 => PI
25
+
26
+ ## Conditions
27
+ number = -42 if opposite.
28
+ /* or
29
+ number = -42 if opposite is true.
30
+ number = -42 unless opposite is false.
31
+ */
32
+
33
+ ## Functions
34
+ $square x {
35
+ <- x^2
36
+ }
37
+ /* or, with +math
38
+ square(x) = x^2
39
+ */
40
+ $eat f {
41
+ $doc.writeln "I ate the ${f}<br>"
42
+ }
43
+ $discuss f {
44
+ // f[f.length-1]
45
+ #s = "s" if f#01 != 's'.
46
+ else s = "";
47
+ $doc.writeln "The ${f} look${s} good<br>"
48
+ }
49
+ $doc.writeln = $x {
50
+ $doc.body.$html += "${x}<br>"
51
+ }
52
+
53
+ ## Arrays
54
+ #list = [1, 2, 3, 4, 5]
55
+
56
+ ## Objects
57
+ #math = {
58
+ root: @.sqrt
59
+ square: square
60
+ cube: $x {
61
+ <- x^3
62
+ }
63
+ }
64
+
65
+ ## Splats + Interpolation
66
+ $race winner, runners... {
67
+ $doc.writeln "${winner}, ${runners}"
68
+ }
69
+
70
+ ## Existence
71
+ alert "I knew it" if Elvis exists.
72
+
73
+ ## Array comprehension
74
+ #menu = ['tacos', 'burritos', 'sushi', 'spaghetti']
75
+
76
+ if menu exists {
77
+ discuss food from menu
78
+ }
79
+
80
+ eat food from menu while the food isnt "sushi"
81
+
82
+ ## Simple English
83
+ #sushi = "sushi" from menu
84
+ #third = 3 in menu
85
+
86
+ ## Reserved words
87
+ #off = off
88
+ off = off OR NOT on
89
+
90
+ ## Spanning functions
91
+ #prom fnName
92
+ $fnName <String string, Number number> {
93
+ <- "You sent: '${string}', and ${number}"
94
+ }
95
+
96
+ $fnName <Object object, Array array> {
97
+ <- "You sent an object and array"
98
+ }
99
+
100
+ $fnName <RegExp regexp, Boolean bool> {
101
+ <- "It's ${bool} that ${regexp} matches everything"
102
+ }
0 commit comments