Switched to a bit more standard notation
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
# [number][number] - move from column/freecell to column/freecell/foundation:
|
||||
# - 0 is foundation (can be omitted)
|
||||
# - 1 to 8 are column numbers
|
||||
# - 9 to 12 are freecell numbers
|
||||
# - a, b, c, d are freecell numbers
|
||||
# SEED variable can be used to init games M$-style
|
||||
# no supermove support for now, need to move cards one at a time
|
||||
# created by Luxferre in 2024, released into public domain
|
||||
@@ -98,11 +98,20 @@ function domove(cmd, valid, nums, from, to, si) {
|
||||
}
|
||||
valid = 0 # invalid by default until all checks are done
|
||||
# if cmd is not q or one of the above, then it must be two numbers
|
||||
# 1 to 8 is the column (tableau) number
|
||||
# 9 to 12 are free cell indices, 0 means foundation
|
||||
split(cmd, nums, "") # numbers must be space-separated
|
||||
from = int(nums[1]) # location from which we're moving
|
||||
to = int(nums[2]) # location to which we're moving
|
||||
from = nums[1] # location from which we're moving
|
||||
to = nums[2] # location to which we're moving
|
||||
# identify free cells
|
||||
if(from == "a") from = 9
|
||||
if(from == "b") from = 10
|
||||
if(from == "c") from = 11
|
||||
if(from == "d") from = 12
|
||||
if(to == "a") to = 9
|
||||
if(to == "b") to = 10
|
||||
if(to == "c") to = 11
|
||||
if(to == "d") to = 12
|
||||
from = int(from)
|
||||
to = int(to)
|
||||
rfrom = from - 1 # real from location
|
||||
rto = to - 1 # real to location
|
||||
if(from > 0 && from < 13 && to > -1 && to < 13) { # first check
|
||||
|
||||
Reference in New Issue
Block a user