mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
If-then-else is working, untested
This commit is contained in:
@@ -1,10 +1,44 @@
|
||||
|
||||
|
||||
//literals
|
||||
if (true) {
|
||||
print "Success";
|
||||
}
|
||||
|
||||
else {
|
||||
print "Failed";
|
||||
}
|
||||
|
||||
//false literals
|
||||
if (false) {
|
||||
print "Failed";
|
||||
}
|
||||
else {
|
||||
print "Success";
|
||||
}
|
||||
|
||||
//conditionals
|
||||
if (1 < 2) {
|
||||
print "Success";
|
||||
}
|
||||
if (1 > 2) {
|
||||
print "Failure";
|
||||
}
|
||||
|
||||
|
||||
//variables
|
||||
var a = 42;
|
||||
|
||||
if (a) {
|
||||
print "Success";
|
||||
}
|
||||
else {
|
||||
print "Failure";
|
||||
}
|
||||
|
||||
|
||||
if (a == 42) {
|
||||
print "Success";
|
||||
}
|
||||
else {
|
||||
print "Failure";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user