Lux-AI-Challenge / Lux-Design-S1

Home to the design and engine of the @Lux-AI-Challenge Season 1, hosted on @kaggle
https://lux-ai.org/
Apache License 2.0
897 stars 152 forks source link

validateCommand #59

Closed LittleAlvinMaker closed 3 years ago

LittleAlvinMaker commented 3 years ago

major refactor to make validateCommand() MUCH more readable and less error-prone (NOTE: the code will likely have a bug or two since I have no test harness)

StoneT2000 commented 3 years ago

yeah this is a large change. i'm not too sure if we will ever merge this in. to test though, you can run

npm test

this will test nearly all of the validations.

LittleAlvinMaker commented 3 years ago

I have corrected the couple syntax errors and the flipped logical check, and it now passes all of the validation tests.

StoneT2000 commented 3 years ago

just read through it, merged main branch to here. looks great, thanks!

StoneT2000 commented 3 years ago

also this is fixed in the main branch now but we cannot use +args[0] is a integer parsing syntax as this allows floats to go through e.g. +"1.23" gives 1.23 which would cause some bugs.