File:  [CSRG BSD Unix] / 43BSD / contrib / icon / book / 14 / 8q.icn
Revision 1.1: download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
CVS tags: MAIN, HEAD
Initial revision

procedure main()
   write(q(1),q(2),q(3),q(4),q(5),q(6),q(7),q(8))
end

procedure q(c)
   suspend place(1 to 8,c)	# look for a row
end

procedure place(r,c)
   static up, down, row
   initial {
      up := list(15,0)
      down := list(15,0)
      row := list(8,0)
      }
   if row[r] = down[r + c - 1] = up[8 + r - c] = 0
   then suspend row[r] <- down[r + c - 1] <-
      up[8 + r - c] <- r	# place if free
end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.