GridControl-Team / GridControl

GridControl is a Free-to-play In-browser Social Massive-Multiplayer-Online Game, where you control your bot using a specialized stack-based language (called gridlang) and your github account. Your bot can roam the grid, gather resources, and attack/avoid other bots. The best code wins!
http://gridcontrol.freelancedreams.com/
8 stars 0 forks source link

Add PUSHN opcode #13

Closed lessandro closed 11 years ago

lessandro commented 11 years ago

PUSHN should pop the number of repetitions n, then the value to push, and push the value n times onto the stack.

# Stack: []

PUSH 0
PUSH 10
PUSHN

# Stack: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

This is important for allocating big arrays without using up too many ticks.

sirpengi commented 11 years ago

Implemented as DUPN instead. PUSH takes inline argument, rather than from the stack, so this is more related to DUP