CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
8
Task/Boolean-values/CMake/boolean-values.cmake
Normal file
8
Task/Boolean-values/CMake/boolean-values.cmake
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
foreach(var 1 42 ON yes True y Princess
|
||||
0 OFF no False n Princess-NOTFOUND)
|
||||
if(var)
|
||||
message(STATUS "${var} is true.")
|
||||
else()
|
||||
message(STATUS "${var} is false.")
|
||||
endif()
|
||||
endforeach(var)
|
||||
1
Task/Boolean-values/Clean/boolean-values.clean
Normal file
1
Task/Boolean-values/Clean/boolean-values.clean
Normal file
|
|
@ -0,0 +1 @@
|
|||
::Bool = False | True
|
||||
8
Task/Boolean-values/E/boolean-values-1.e
Normal file
8
Task/Boolean-values/E/boolean-values-1.e
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
? if (true) { "a" } else { "b" }
|
||||
# value: "a"
|
||||
|
||||
? if (false) { "a" } else { "b" }
|
||||
# value: "b"
|
||||
|
||||
? if (90) { "a" } else { "b" }
|
||||
# problem: the int 90 doesn't coerce to a boolean
|
||||
7
Task/Boolean-values/E/boolean-values-2.e
Normal file
7
Task/Boolean-values/E/boolean-values-2.e
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
? def bowlian {
|
||||
> to __conformTo(guard) {
|
||||
> if (guard == boolean) { return true }
|
||||
> }
|
||||
> }
|
||||
> if (bowlian) { "a" } else { "b" }
|
||||
# value: "a"
|
||||
20
Task/Boolean-values/EGL/boolean-values.egl
Normal file
20
Task/Boolean-values/EGL/boolean-values.egl
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
myBool boolean = 0;
|
||||
SysLib.writeStdout("myBool: " + StrLib.booleanAsString(myBool));
|
||||
myBool = 1;
|
||||
SysLib.writeStdout("myBool: " + StrLib.booleanAsString(myBool));
|
||||
myBool = 2;
|
||||
SysLib.writeStdout("myBool: " + StrLib.booleanAsString(myBool));
|
||||
myBool = false;
|
||||
SysLib.writeStdout("myBool: " + StrLib.booleanAsString(myBool));
|
||||
myBool = true;
|
||||
SysLib.writeStdout("myBool: " + StrLib.booleanAsString(myBool));
|
||||
myInt int = 0;
|
||||
SysLib.writeStdout("myInt: " + StrLib.booleanAsString(myInt));
|
||||
myInt = 1;
|
||||
SysLib.writeStdout("myInt: " + StrLib.booleanAsString(myInt));
|
||||
myInt = 2;
|
||||
SysLib.writeStdout("myInt: " + StrLib.booleanAsString(myInt));
|
||||
myInt = false;
|
||||
SysLib.writeStdout("myInt: " + StrLib.booleanAsString(myInt));
|
||||
myInt = true;
|
||||
SysLib.writeStdout("myInt: " + StrLib.booleanAsString(myInt));
|
||||
Loading…
Add table
Add a link
Reference in a new issue