I hereby claim:
- I am jeffxchu on github.
- I am jeffxchu (https://keybase.io/jeffxchu) on keybase.
- I have a public key ASA6Fvj1vIMlri8xwJCyP0_ak5DkwDhtY44_JkrxITxmcQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import kotlin.random.Random | |
fun main() { | |
val gridSize = 10 | |
val numEnemies = 15 | |
val maxBombs = 20 | |
var bombsUsed = 0 | |
var enemiesHit = 0 | |
val board = Array(gridSize) { |
fun parseLisp(input: String): Any? { | |
val tokens = tokenize(input).iterator() | |
return if (tokens.hasNext()) parse(tokens) else null | |
} | |
fun parse(tokens: Iterator<String>): Any? { | |
val token = tokens.next() | |
return when (token) { | |
"(" -> parseList(tokens) | |
")" -> null // This shouldn't happen if the input is well-formed |