Add some scratch bits of code that may one day be useful.
This commit is contained in:
parent
a6fe8839cd
commit
cea195a85b
9
scratch/math.ks
Normal file
9
scratch/math.ks
Normal 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
15
scratch/misc.ks
Normal 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.
|
||||||
|
// }
|
Loading…
Reference in New Issue
Block a user