%export ring_net ring_sd
        tiny_net tiny_sd
        theBulbQuestNet theBulbQuestNet_sd
%include "Markov"
tiny_net :: net
  tiny_net = create_net [(1,[2,3]),(2,[3,1]),(3,[1,2])]

tiny_sd :: short_descriptions
  tiny_sd = create_sd [(1, "Node no. 1"),
                       (2, "This is node 2................................"),
                       (3, "")
                      ]



ring_net :: net
  ring_net = create_net [(1,[2]),(2,[3]),(3,[1])]

ring_sd :: short_descriptions
  ring_sd = ("RING-NET. "++) . tiny_sd





theBulbQuestNet :: net
  theBulbQuestNet
    = create_net
      [
       (0,[1]),
       (1,[30]),
       (2,[2]),
       (3,[3]),
       (4,[43,18]),
       (5,[31]),
       (6,[12,58]),
       (7,[37,53,46]),
       (8,[8]),
       (9,[21,30]),
       (10,[30]),
       (11,[7]),
       (12,[6,34]),
       (13,[13]),
       (14,[52]),
       (15,[23,7]),
       (16,[41,56]),
       (17,[54]),
       (18,[50,55]),
       (19,[42]),
       (20,[6,34]),
       (21,[21]),
       (23,[5]),
       (24,[10,45]),
       (25,[40,17]),
       (26,[16]),
       (27,[42]),
       (28,[39,16]),
       (29,[30]),
       (30,[29,15,24]),
       (31,[31]),
       (32,[32]),
       (33,[19,49]),
       (34,[44,51]),
       (35,[5,31]),
       (36,[15,2]),
       (37,[7]),
       (38,[50,55]),
       (39,[57]),
       (40,[47]),
       (41,[48]),
       (42,[13,25]),
       (43,[38]),
       (44,[6,34]),
       (45,[24,30]),
       (46,[11,7]),
       (47,[40]),
       (48,[32,3]),
       (49,[4,27]),
       (50,[36]),
       (51,[14]),
       (52,[8,28]),
       (53,[33,30]),
       (54,[9,35]),
       (55,[20,36]),
       (56,[56]),
       (57,[26,48]),
       (58,[6,34])
      ]

theBulbQuestNet_sd :: short_descriptions
  theBulbQuestNet_sd
    = create_sd
      [
       (0,"Start (everything goes dark)"),
       (1,"The Quest for the Replacement Bulb"),
       (2,"AARGH!!! died in tutorial"),
       (3,"YOU'VE WON!!! (pity about Careers)"),
       (4,"letter to FELIX"),
       (5,"try yourself after President fails"),
       (6,"the catacombs of Sherfield..."),
       (7,"your Union is ready to help you(!)"),
       (8,"AARGH!!! piranha rats"),
       (9,"LHSTTFLBRFSSSC says no money"),
       (10,"no bulbs till 5th August 2056"),
       (11,"(censored)"),
       (12,"To the HUB Office (again)"),
       (13,"AARGH!!! Juggernaut time"),
       (14,"recover from HUB experience"),
       (15,"trying Union office"),
       (16,"a bill is presented"),
       (17,"Belushi's Listeria special"),
       (18,"editor deliberately loses article"),
       (19,"buying rounds can be tough"),
       (20,"To the HUB Office"),
       (21,"YOU ARE A HACK. End of Game."),
       (23,"membership has its privileges"),
       (24,"I need an R27b"),
       (25,"feeling hungry"),
       (26,"venturing back to HUB"),
       (27,"DP finds the axe 'interesting'"),
       (28,"more than just a replacement..."),
       (29,"Southside shop: a case of screws"),
       (30,"decide where to go for the bulb"),
       (31,"Union President (deceased)."),
       (32,"Nobody crosses HUB and lives."),
       (33,"House Committee meeting"),
       (34,"in the tunnels"),
       (35,"LHSTTFLBRFSSSC has the goods....."),
       (36,"try Union Office or tutorial"),
       (37,"the President's very busy indeed"),
       (38,"editor accidentally loses article"),
       (39,"an envelope is discovered"),
       (40,"Have some curried caterpillar!"),
       (41,"panic in the tunnels"),
       (42,"time to kill"),
       (43,"isn't collating boring"),
       (44,"an unlocked high security door"),
       (45,"a taste of Sherfield absenteeism"),
       (46,"noises from the Hon Sec's abode"),
       (47,"You're slowly starving to death....."),
       (48,"Rugby Club offer their services"),
       (49,"tight-fisted bastard time"),
       (50,"an exchange with the FELIX editor"),
       (51,"ENTERING THE HUB OFFICE NOW........"),
       (52,"work in progress"),
       (53,"bye bye Amazon Rain Forest"),
       (54,"LHSTTFLBRFSSSC convenes a meeting"),
       (55,"HUB office hears of your trouble"),
       (56,"AARGH!!! sold to Biochemistry"),
       (57,"a bill is encountered"),
       (58,"To the HUB Office (again)")
      ]














create_net :: [(node, choices)] -> net
  create_net = list_to_function

create_sd :: [(node, short_description)] -> short_descriptions
  create_sd = list_to_function

list_to_function :: [(*,**)] -> * -> **
  list_to_function [] a = error "list_to_function: input not listed"
  list_to_function ((a,b):rest) a = b
  list_to_function ((a',b):rest) a = list_to_function rest a
