Annotation of 43BSD/contrib/icon/book/14/8q.icn, revision 1.1.1.1

1.1       root        1: procedure main()
                      2:    write(q(1),q(2),q(3),q(4),q(5),q(6),q(7),q(8))
                      3: end
                      4: 
                      5: procedure q(c)
                      6:    suspend place(1 to 8,c)     # look for a row
                      7: end
                      8: 
                      9: procedure place(r,c)
                     10:    static up, down, row
                     11:    initial {
                     12:       up := list(15,0)
                     13:       down := list(15,0)
                     14:       row := list(8,0)
                     15:       }
                     16:    if row[r] = down[r + c - 1] = up[8 + r - c] = 0
                     17:    then suspend row[r] <- down[r + c - 1] <-
                     18:       up[8 + r - c] <- r       # place if free
                     19: end

unix.superglobalmegacorp.com

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