Game Simulator
How to modify this for a new game
TODO
nonStockPileTemplate
isn't as robust as the stockpileTemplate2024
STEP 1
Use one of these template files depending on if you want stockpiling:
STEP 2
Adapt lines
160-184
for the specific game you have in mind. Read the comments, as they can be descriptive.STEP 3
Then edit the forloop right after the comment:
//create a scenario tree
STEP 4
Last edit the following functions:
autonScorePiece()
andscorePiece()
END
Functions
l()
:
parameters: ...
return:
use: shorthand printinputToggled()
:
parameters:
return:
use: when the display for user input is toggledcalculate()
:
parameters:
return:
use: reloads page with user inputencodeScenario(String)
:
parameters:String
: numerical string of length equal to length of iteratingArrays
return:UINT
use: compresses readable form of a scenario into a number
decodeScenario(UINT)
:
parameters:UINT
return: numerical string
use: decompresses a number into a readable form of a scenario
scorePiece(UINT, Boolean)
:
parameters:UINT
: compressed scenarioBoolean
: true if alreadyHoldingAndPositioned
return:
use: simulates a robot scoring a piece(s)
addPlotData(UINT, String)
:
parameters:UINT
: compressed scenarioString
: an action the robot does
return:
use: pushes plot data to arrays
updatedata(UINT)
:
parameters:UINT
: compressed scenario
return:
use: updates which scenario’s data is being displayed in the right side of split screen
autonScorePiece(UINT)
:
parameters:UINT
: compressed scenario
return:
use: simulates a robot scoring a piece(s) in auton