Wednesday, February 9, 2011

wumpus-drawing

Copperbox revision 2125.

Work on an automata example.

I'm currently somewhat stuck with the code I started yesterday for labels - my feeling is that only LocImages / LocGraphics will actually be able to use labels so I shouldn't need the Label typeclass. However, I haven't committed to this yet, and I've been working on an automata example that uses new placing idioms based on this afternoon's commit:







automata :: DCtxPicture
automata = drawTracing $ do
    q0     <- starti   $ state
    q1     <- relativei  (above_right q0)      $ state
    q2     <- relativei  (below_right q0)      $ state
    q3     <- relativei  (below_right q1)      $ state

    s0     <- query (left_of q0)
   
    drawcr q0 q1 $ straightconn
    drawcr q1 q3 $ straightconn
    drawcr q0 q2 $ straightconn
    drawcr q2 q3 $ straightconn
    drawc  s0 (west q0) $ straightconn

    return ()

There are no absolute positions in any of the code (note - the names starti etc. will likely change).

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.