Advertisement
chunkations

Untitled

Jul 20th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.59 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <stropts.h>
  4. #include <arch/zx.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7.  
  8. extern FILE *window_1;
  9. extern FILE *window_2;
  10.  
  11. typedef struct{
  12.  
  13. unsigned char number;
  14. }room;
  15.  
  16. room myrooms[9];
  17.  
  18.  
  19. myrooms[0].number=1;
  20. myrooms[0].desc="Bruce Hall, a slightly built youth 16 years of age, fair haired and blue eyed, stood 4' 8 \" in shoes and despite that slight assistance still could not see over the brick wall behind which he believed stood a flying machine. At least that was what he'd overheard two delivery boys discussing outside the local butchers shop."
  21.  
  22. "I aint lying Sid, I seen it wiv me own eyes. It were one of them airyplanes, I'd swear to it. I couldn't see it proper mind cos the bloke dint want me ter come in past the gatehouse when I was delivering 'is bangers. Tole me ter mind me own business and keep me mouf shut. So I stood up on the pedals of me bike an' just caught a look at sumfing like a big box kite. Well wot else could it be, tell me that?"
  23.  
  24. "Don't be so daft Alf! I know that place, its all full of box hedges and that, like a maze sorta fing. One o' them fancy gardens the nobs has wiv all fountains and peacocks and fings. 'ow could a bloke get a flying machine dahn in that lot unless ee crashed o' course. I bet wot you saw was prolly a marquee or sumfing for a garden party most likely. I'll ask old Bert when I see 'im e's a gardener there."
  25.  
  26. "Bruce nicknamed Toad by his school mates for obvious reasons, had what almost amounted to an obsession about flying. He'd designed and built a succession of models, each larger than its predessor and most of which now rested in the uppermost branches of various trees or as crumpled remains, after encountering a more solid structure and falling to earth. He collected every magazine and book he could find with descriptions of these"
  27. " fledgling machines and their intrepid pilots but had yet to see one in flight or even earthbound despite his best efforts at tracking one down though he knew they were to be found quite close by."
  28.  
  29. "Being effectively a prisoner of his boarding school with only the freedom permitted by the tradition of Sunday Walks, Bruce's effective radius of travel within the time allotted was only about three miles and the local flying field was five miles distant. It was unlikely that a flyer would ever pass over the school especially since to do so would mean having to fly over the town and as he knew well they were restricted to flights over open country as much for their own safety as anyone elses."
  30.  
  31. "So, here was possibly his best opportunity to see an aircraft up close, if indeed it really was behind the wall but situated as it was parallel to a busy main road and completely lacking convenient trees or other means of scalng it easily, he had to find a way in and the tall iron gates that barred entrance to the driveway were the best point of entry, he could probably have squeezed between their bars were it not for the ever vigilant gate keeper who resided in the gatehouse that was part of the ornate brick archway."
  32.  
  33. "Toad considered his options, should he:-"
  34. "CLIMB 1. Make an attempt at climbing the wall despite the difficulty (CLI)"
  35. "KNOCK 2. Knock at the gatehouse door and ask to retrieve something of his that the wind blew over the wall. (KNO)"
  36. "SEARCH 3. Keep walking the perimeter searching for another way in. (SEA)"
  37. "END";
  38.  
  39.  
  40. main()
  41. {
  42.    static int i;
  43.    static unsigned char buffer[5];
  44.  
  45.    zx_border(INK_BLACK);
  46.    zx_cls(INK_GREEN | PAPER_GREEN);
  47.  
  48.    ioctl(1, IOCTL_OTERM_CLS);
  49.    ioctl(2, IOCTL_OTERM_CLS);
  50.    // i = ioctl(2, IOCTL_OTERM_FCOLOR, INK_BLACK | PAPER_MAGENTA);
  51.          ioctl(2, IOCTL_OTERM_FCOLOR, INK_BLUE | PAPER_MAGENTA);
  52.     //fprintf(window_1, "\nEnter some text: ");
  53.        memset(buffer, 0, 5);
  54.        ioctl(1, IOCTL_OTERM_PAUSE, 1);
  55.        fprintf(window_1, "%s\n", rooms[0].desc);
  56.      
  57.    while (1)
  58.    {
  59.       // fill buffer with random letters
  60.      
  61.    
  62.      
  63.    //   for (i = rand() % 100; i >= 0; --i)
  64.         // buffer[i] = (unsigned char)((rand() % ('z' - ' ')) + ' ');
  65.      
  66.       // print to both windows
  67.      
  68.      // fprintf(window_1, "%s\n", buffer);
  69.      // fprintf(window_2, "%s\n", buffer);
  70.      
  71.       // gather input
  72.      
  73.      // if (rand() > 32200)
  74.       //{
  75.          
  76.          
  77.          fflush(stdin);
  78.          scanf("%99[^\n]", buffer);
  79.            fprintf(window_1, "%s\n", buffer);
  80.         //  ioctl(1, IOCTL_OTERM_SCROLL, 5);
  81.      
  82.        //  i = ioctl(2, IOCTL_OTERM_FCOLOR, INK_BLACK | PAPER_BLUE);
  83.          fprintf(window_2, "\n%s\n\n", buffer);
  84.        //  ioctl(2, IOCTL_OTERM_FCOLOR, i);
  85.      // }
  86.    }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement