Add some scratch bits of code that may one day be useful.

This commit is contained in:
Anna Rose 2021-07-22 13:38:19 -04:00
parent a6fe8839cd
commit cea195a85b
2 changed files with 24 additions and 0 deletions

9
scratch/math.ks Normal file
View File

@ -0,0 +1,9 @@
@lazyglobal off.
function Bound {
parameter minB.
parameter maxB.
parameter value.
return min(max(value, minB), maxB).
}

15
scratch/misc.ks Normal file
View File

@ -0,0 +1,15 @@
// Check for various sensors and set appropriate global constants.
// Currently only checks for grav sensor, as that's the only one used by this library.
// global HAS_GRAV_SENSOR is false.
// function SensorCheck {
// local SensorList is 0.
// list SENSORS in SensorList.
// for s in SensorList {
// if s:type = "grav" {
// print "Gravometric sensor detected".
// set HAS_GRAV_SENSOR to true.
// return.
// }
// }
// set HAS_GRAV_SENSOR to false.
// }