Modified test file to represent real in-game code
This commit is contained in:
9
libs/compiler/test_files/deviceIo.slang
Normal file
9
libs/compiler/test_files/deviceIo.slang
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
device airConditioner = "d0";
|
||||||
|
device gasSensor = "d1";
|
||||||
|
|
||||||
|
loop {
|
||||||
|
yield();
|
||||||
|
let indoorTemp = loadFromDevice(gasSensor, "Temperature");
|
||||||
|
let shouldSet = indoorTemp > 30c;
|
||||||
|
setOnDevice(airConditioner, "On", shouldSet);
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fn addTemperatures(temp1, temp2) {
|
|
||||||
return temp1 + temp2;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
let newTemp1 = addTemperatures(15c, 120c);
|
|
||||||
let newTemp2 = addTemperatures(50c, 20c);
|
|
||||||
Reference in New Issue
Block a user