[ create a new paste ] login | about

Link: http://codepad.org/HuZUqhoc    [ raw code | fork ]

Plain Text, pasted on Sep 1:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Let no_move_left be the proposition you cannot move to the left
Let no_move_right be the proposition you cannot move to the right
Let can_move_left be the proposition you can move left
Let can_move_right be the proposition you can move right

':=' means 'abbreviates for'.

start := (no_move_left and can_move_left) same-as not(can_move_left)
end := (no_move_right and can_move_right) same-as not(can_move_right)
elsewhere := ((not(start) and not(end)) and can_move_left) or ((not(start) and not(end)) and can_move_right)

validLocation := (start or end or elsewhere)

If validLocation is true, then movement is possible to the left xor right.

noMove := (start and end)

If noMove is true, then no movement is possible in either direction.


Create a new paste based on this one


Comments: