-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexamples.txt
More file actions
104 lines (78 loc) · 1.91 KB
/
examples.txt
File metadata and controls
104 lines (78 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// // String manipulation
// #get_name string name int age
// var string newName = My name is ^s
// $newName += $name
// $newName += ^s and I am ^s
// $newName += $age
// $newName += ^s years old
// return $newName
// #endget_name
// var string name = #get_name Bob 18
// print $name
// // String manipulation With loops
// #get_name string name
// var string newName = My name is ^s
// $newName += $name
// $newName += ^s and I am ^s
// $newName += $age
// $newName += ^s years old
// return $newName
// #endget_name
// #loop string
// var int age = $index
// var string name = #get_name Bob
// print $name
// #endloop
// repeat 18 #loop
// // Get name and age and print it out
// #get_name
// var string newName = My name is ^s
// $newName += $name
// $newName += ^s and I am ^s
// $newName += $age
// $newName += ^s years old
// return $newName
// #endget_name
// var string name = ^s
// var int age = 0
// input name Whats your name: ^s
// input age How old are you: ^s
// var string newName = #get_name
// print $newName
// // How many characters is there in your name
// var string name = ^s
// var string result = There is ^s
// var int nameLength = 0
// input name Whats your name: ^s
// length nameLength $name
// $result += $nameLength
// $result += ^s characters in the name ^s
// $result += $name
// print $result
// // Get characters
// #loop string name
// print $name[$index]
// #endloop
// var string name = Bob
// var int nameLength = 0
// length nameLength $name
// $nameLength -= 1
// repeat $nameLength #loop $name
// // 10 print algorithm
// #loop
// #slash
// print /^l
// #endslash
// #backslash
// print \\^l
// #endbackslash
// var float t
// random t
// if $t < 0.5 #slash
// if $t > 0.5 #backslash
// #endloop
// repeat 1000 #loop
// // Type alias
// type mystring = string
// var mystring name = My name
// print $name