"Returns a list of all values present in row x of map"
(let((rownil))
(loopforifrom0to8do
(setfrow(cons(arefmapxi)row)))
(remove-if(lambda(e)(=e0))row)))
(defunget-col(mapy)
"Returns a list of all values in column y of map"
(let((colnil))
(loopforifrom0to8do
(setfcol(cons(arefmapiy)col)))
(remove-if(lambda(e)(=e0))col)))
(defunget-zone(mapxy)
"Returns a list of all values for the zone which contains cell x,y."
(let((zonenil)
(zx(*3(floor(/x3))))
(zy(*3(floor(/y3)))))
(loopforifrom0to2do
(loopforjfrom0to2do
(setfzone(cons(arefmap(+zxi)(+zyj))zone))))
(remove-if(lambda(e)(=e0))zone)))
(defunget-valid-for-pos(mapxy)
"Returns the list of presently-valid remaining values for cell x,y in map"
(if(=0(arefmapxy))
(let((row(get-rowmapx))
(col(get-colmapy))
(zone(get-zonemapxy))
(valid'(123456789)))
(setfvalid(set-differencevalidrow))
(setfvalid(set-differencevalidcol))
(set-differencevalidzone))))
(defunget-min-move-count(map)
"Returns the cell coordinates in list form '(x y) for the cell with the lowest number of presently-valid remaining values. It also returns the count of this quantity"