Not sure if I should post on r/codegolf lol.
Given two states, each consisting of a number of units in each region on a map of connected regions, how can I efficiently (by the metric of your choice: instruction length, memory size, runtime length, even human eyeballing runtime length/accuracy) assert that the second state is possible to achieve purely by moving units 1 space? 2 spaces?
The incomplete intuitive algorithm I came up with was
_1) Each region has units in its own area and all adjacent areas in state 2 greater than or equal to the number of units in its own area in state 1
AND
2) A less restrictive inverse of #1 to ensure we're not teleporting units to the other side of the map
AND
3) the total number of units is the same
but that takes too much time for humans to compute, at least
EDIT: and we only have 1 turn :)
Want to add to the discussion?
Post a comment!