delete-from-cell ( board location obj -- board )


Vocabulary
gamelib.board

Inputs
boardan object
locationan object
objan object


Outputs
boardan object


Definition


:: delete-from-cell ( board location obj -- board )
board location get-cell :> cell cell [ obj = ] find drop
:> obj-index obj-index [
obj-index cell remove-nth
:> new-cell board location new-cell set-cell
] [ board ] if ;