|
|
|
|
|
by nailer
2879 days ago
|
|
I removed everything that seems redundant. Less syntax means less to break, and less for new programmers (who are 10x the volume of existing programmers) to learn: import 'package:hauberk/src/engine.dart'
import 'package:hauberk/src/content.dart'
content = createContent()
save = content.createHero("blah")
while (true)
watch = Stopwatch()
watch.start()
# Generate a dungeon at each level.
count = 0
for (i = 1; i <= Option.maxDepth; i++)
game = Game(content, save, 1)
for (_ in game.generate())
# Read some bit of game data so the JIT doesn't optimize the whole program away as dead code.
if (game.hero.pos.x >= -1) count++
watch.stop()
print("Generated $count dungeons in ${watch.elapsedMilliseconds}ms")
|
|