home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!wupost!uwm.edu!ux1.cso.uiuc.edu!umn.edu!news.cs.indiana.edu!bsu-cs!bsu-ucs.uucp!00mjstum
- From: 00mjstum@bsu-ucs.uucp (Matthew J. Stum)
- Newsgroups: vmsnet.sources.games
- Subject: AYO, part 002 OF 002
- Message-ID: <1992Jul16.103609.8754@bsu-ucs.uucp>
- Date: 16 Jul 92 15:36:09 GMT
- Lines: 328
-
- -+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+
- X`09`09`09 end
- X`09`09`09 else
- X`09`09`09 begin
- X`09`09`09`09done:=true;
- X`09`09`09`09really_done:=true;
- X`09`09`09 end;
- X`09`09until done;
- X`09`09divy_up(comp_start);
- X`09`09if comp_start in `5B'a','m'`5D then really_done:=true;
- X`09`09if not really_done then
- X`09`09 begin
- X`09`09`09set_ownership;
- X`09`09`09init_pockets;
- X`09`09`09show_seeds;
- X`09`09`09hand:=0; comp:=0;
- X`09`09`09show_captured;
- X`09`09 end;
- X`09until really_done;
- X`09if comp_start='a' then
- X`09`09writeln(esc,'`5B20;33HYeah! I won...')
- X`09 else
- X`09if comp_start='m' then
- X`09`09writeln(esc,'`5B20;30HGood Job! You won...')
- X`09 else
- X`09`09writeln(esc,'`5B20;32HHave a nice day!');
- X`09writeln(esc,'`5B23;1HPress any key to continue...');
- X`09stat:=$qiow(chan:=iochan,func:=func,p1:=key,p2:=1);
- Xend;
- X
- Xprocedure get_game_info;
- Xbegin
- X`09writeln;
- X`09writeln('Difficulty Level: (1-3)');
- X`09writeln;
- X`09repeat
- X`09`09stat:=$qiow(chan:=iochan,func:=func,p1:=key,p2:=1);
- X`09until key in `5B'1','2','3'`5D;
- X`09difficulty_level:=(ord(key)-ord('0'))*2;
- X`09writeln;
- X`09writeln('Who goes first?');
- X`09writeln(' 1) You');
- X`09writeln(' 2) The computer');
- X`09writeln(' 3) Flip for it');
- X`09writeln;
- X`09repeat
- X`09`09stat:=$qiow(chan:=iochan,func:=func,p1:=key,p2:=1);
- X`09until key in `5B'1','2','3'`5D;
- X`09case key of
- X`09`09'1': player:=p1;
- X`09`09'2': player:=p2;
- X`09`09'3': begin
- X`09`09`09for i:=23 downto 12 do
- X`09`09`09 begin
- X`09`09`09`09write(esc,'`5B',i:1,';40H');
- X`09`09`09`09case i mod 4 of
- X`09`09`09`09`090:writeln('\');
- X`09`09`09`09`091:writeln('-');
- X`09`09`09`09`092:writeln('/');
- X`09`09`09`09`093:writeln('`7C');
- X`09`09`09`09end;
- X`09`09`09`09writeln(esc,'`5B',i:1,';40H ');
- X`09`09`09 end;
- X`09`09`09writeln(esc,'`5B12;40H-');
- X`09`09`09writeln(esc,'`5B12;40H ');
- X`09`09`09writeln(esc,'`5B12;40H\');
- X`09`09`09writeln(esc,'`5B12;40H ');
- X`09`09`09writeln(esc,'`5B12;40H`7C');
- X`09`09`09writeln(esc,'`5B12;40H ');
- X`09`09`09writeln(esc,'`5B12;40H/');
- X`09`09`09writeln(esc,'`5B12;40H ');
- X`09`09`09for i:=12 to 23 do
- X`09`09`09 begin
- X`09`09`09`09write(esc,'`5B',i:1,';40H');
- X`09`09`09`09case i mod 4 of
- X`09`09`09`09`090:writeln('-');
- X`09`09`09`09`091:writeln('\');
- X`09`09`09`09`092:writeln('`7C');
- X`09`09`09`09`093:writeln('/');
- X`09`09`09`09end;
- X`09`09`09`09writeln(esc,'`5B',i:1,';40H ');
- X`09`09`09 end;
- X`09`09`09time(tm);
- X`09`09`09if odd(ord(tm`5B11`5D)) then
- X`09`09`09 begin
- X`09`09`09`09player:=p1;
- X`09`09`09`09writeln(esc,'`5B18;1HYou go first, press any key...');
- X`09`09`09 end
- X`09`09`09 else
- X`09`09`09 begin
- X`09`09`09`09player:=p2;
- X`09`09`09`09writeln(esc,'`5B18;1HThe computer goes first, press any key...')
- V;
- X`09`09`09 end;
- X`09`09`09stat:=$qiow(chan:=iochan,func:=func,p1:=key,p2:=1);
- X`09`09 end;
- X`09end;
- Xend;
- X
- Xprocedure background_rules;
- Xbegin
- Xwrite(esc,'`5B2J',esc,'`5B1;1H');
- Xwriteln(' Ayo');
- Xwriteln;
- Xwriteln(' A West African Board Game');
- Xwriteln;
- Xwriteln;
- Xwriteln('`09Ayo is one version of a type of game played widely in Africa and
- V Asia. ');
- Xwriteln('It goes under different names in different places and even has wide
- Vly different');
- Xwriteln('board configurations and rules, but the versions all share the feat
- Vures and');
- Xwriteln('general strategies of moving numbers of seeds along pockets to capt
- Vure seeds');
- Xwriteln('and, ultimately, pockets. The version presented here is the one fo
- Vund among');
- Xwriteln('the Yoruba (pronounced YO-roo-bah, accent on the first syllable) of
- V');
- Xwriteln('southwestern Nigeria, in West Africa. ');
- Xwriteln(esc,'`5B23;1HPress any key to continue...');
- Xstat:=$qiow(chan:=iochan,func:=func,p1:=key,p2:=1);
- Xwrite(esc,'`5B2J',esc,'`5B1;1H');
- Xwriteln(' Ayo');
- Xwriteln;
- Xwriteln(' A West African Board Game');
- Xwriteln;
- Xwriteln;
- Xwriteln('`09The game consists of a game board and 48 hard, round, greyish se
- Veds. ');
- Xwriteln('The seeds are about the size of marbles, and the board is usually c
- Varved from a');
- Xwriteln('piece of pale hardwood called iroko. (The iroko is a tall rain-for
- Vest hardwood');
- Xwriteln('with flying buttress roots.) The board usually measures about six
- V inches by');
- Xwriteln('twenty inches and has two rows of six pockets carved into it. The
- V pockets are');
- Xwriteln('about two and a half inches in diameter and an inch deep. The game
- Vboard is');
- Xwriteln('about an inch and a half thick and may be carved with traditional d
- Vecorative');
- Xwriteln('figures.');
- Xwriteln(esc,'`5B23;1HPress any key to continue...');
- Xstat:=$qiow(chan:=iochan,func:=func,p1:=key,p2:=1);
- Xwrite(esc,'`5B2J',esc,'`5B1;1H');
- Xwriteln(' Ayo');
- Xwriteln;
- Xwriteln(' A West African Board Game');
- Xwriteln;
- Xwriteln;
- Xwriteln('`09Two players play the game, taking turns moving seeds countercloc
- Vkwise');
- Xwriteln('from their own sides of the board. To make a move, a player takes
- V all the');
- Xwriteln('seeds out of one pocket and deposits them one by one in the pockets
- V to the');
- Xwriteln('right, beginning with the immediately adjacent pocket. If the last
- V seed played');
- Xwriteln('in a player''s turn lands in a pocket that then contains two or thr
- Vee seeds, the');
- Xwriteln('player captures those seeds and removes them from the board. The p
- Vlayer also');
- Xwriteln('captures the seeds in any leftward adjacent pockets that contain tw
- Vo or three. ');
- Xwriteln('The round ends when one player can no longer make a play, whether b
- Vecause no');
- Xwriteln('seeds are left at all or none are left on his (among the Yoruba, on
- Vly men play');
- Xwriteln('the game) side. Both players then put their captured seeds back in
- V the');
- Xwriteln('pockets, four to a pocket, both starting from the same end of board
- V. In the');
- Xwriteln('next round, each player plays from those pockets that he has filled
- V with at ');
- Xwriteln('least three seeds at the end of the previous round. The rounds pro
- Vceed in this');
- Xwriteln('way until one player has captured all of the pockets. A player may
- V play only');
- Xwriteln('from his own pockets but may capture from either side.');
- Xwriteln(esc,'`5B23;1HPress any key to continue...');
- Xstat:=$qiow(chan:=iochan,func:=func,p1:=key,p2:=1);
- Xwrite(esc,'`5B2J',esc,'`5B1;1H');
- Xwriteln(' Ayo');
- Xwriteln;
- Xwriteln(' A West African Board Game');
- Xwriteln;
- Xwriteln;
- Xwriteln('`09Skilled players often use the strategy of holding a number of th
- Ve seeds');
- Xwriteln('from one of their pockets in the left hand so that the opponent can
- Vnot tell how');
- Xwriteln('many seeds are in that pocket. They can do this only with one pock
- Vet at a');
- Xwriteln('time, but they can change the number of seeds from that pocket that
- V they');
- Xwriteln('conceal whenever they wish, and they can also completely change the
- V pocket they');
- Xwriteln('are concealing from by replacing all of the seeds in the first pock
- Vet they had');
- Xwriteln('chosen and removing a number of seeds from another pocket. The pla
- Vyer');
- Xwriteln('concealing some seeds must always leave at least three seeds in a p
- Vocket so');
- Xwriteln('that the pocket does not appear to be capturable.');
- Xwriteln(esc,'`5B23;1HPress any key to continue...');
- Xstat:=$qiow(chan:=iochan,func:=func,p1:=key,p2:=1);
- Xwrite(esc,'`5B2J',esc,'`5B1;1H');
- Xwriteln(' Ayo');
- Xwriteln;
- Xwriteln(' A West African Board Game');
- Xwriteln;
- Xwriteln;
- Xwriteln('`09Yoruba men play this game from childhood and become highly skill
- Ved at');
- Xwriteln('it. They play at such speed that they appear not to think at all,
- V but a slow');
- Xwriteln('player is criticized and often ridiculed. A skilled Ayo player is
- V highly');
- Xwriteln('respected for his skill, so much so that there is even a Yoruba say
- Ving that');
- Xwriteln('translates as "As brave as an Ayo player." ');
- Xwriteln(esc,'`5B23;1HPress any key to continue...');
- Xstat:=$qiow(chan:=iochan,func:=func,p1:=key,p2:=1);
- Xend;
- X
- Xprocedure instructions;
- Xbegin
- Xwrite(esc,'`5B2J',esc,'`5B1;1H');
- Xwriteln(' Ayo');
- Xwriteln;
- Xwriteln(' The Computer Version');
- Xwriteln;
- Xwriteln('`09If you have read the "Background notes and rules" at the main me
- Vnu');
- Xwriteln('of this program, then playing Ayo vs. the computer should not be di
- Vfficult.');
- Xwriteln('When you play Ayo, you will see 12 boxes that look like this: /---
- V-\');
- Xwriteln(' `7C
- V `7C');
- Xwriteln(' \---
- V-/');
- Xwriteln('These boxes represent the pockets. Inside the boxes will be a numb
- Ver. This');
- Xwriteln('represents the number of seeds lying in the pocket.');
- Xwriteln(esc,'`5B23;1HPress any key to continue...');
- Xstat:=$qiow(chan:=iochan,func:=func,p1:=key,p2:=1);
- Xwrite(esc,'`5B2J',esc,'`5B1;1H');
- Xwriteln(' Ayo');
- Xwriteln;
- Xwriteln(' The Computer Version');
- Xwriteln;
- Xwriteln('`09Along the outside of the two rows of pockets are the letters ''A
- V'' through');
- Xwriteln('''L''. These are there to help you tell the computer which pocket
- V you wish to');
- Xwriteln('play from. When it is your turn to play (when you don''t see the w
- Vord');
- Xwriteln('"Thinking..." on the screen) you just simply press the letter corre
- Vsponding to');
- Xwriteln('the pocket you wish to remove the seeds from and the computer will
- V automatically');
- Xwriteln('distribute them, make any captures if possible, and start thinking
- V about its own');
- Xwriteln('next move. Remember, you can only play from a pocket that you own.
- V The pockets');
- Xwriteln('that you own will be indicated by highlighting the number of the se
- Veds in the');
- Xwriteln('pocket with reverse video.');
- Xwriteln(esc,'`5B23;1HPress any key to continue...');
- Xstat:=$qiow(chan:=iochan,func:=func,p1:=key,p2:=1);
- Xwrite(esc,'`5B2J',esc,'`5B1;1H');
- Xwriteln(' Ayo');
- Xwriteln;
- Xwriteln(' The Computer Version');
- Xwriteln;
- Xwriteln('`09Once either you or the computer can no longer move, the computer
- V will');
- Xwriteln('automatically re-distribute the seeds in the pockets, re-mark which
- V pockets you');
- Xwriteln('own, and will begin play again. Play ends when either you or the c
- Vomputer has');
- Xwriteln('captured enough seeds to own all of the pockets. It''s as simple a
- Vs that...');
- Xwriteln(esc,'`5B23;1HPress any key to continue...');
- Xstat:=$qiow(chan:=iochan,func:=func,p1:=key,p2:=1);
- Xend;
- X
- Xbegin
- X`09stat:=$assign('TT:',iochan);
- X`09logging:=false;
- Xrepeat
- X`09writeln(esc,'`5B2J',esc,'`5B1;1H');
- X`09writeln('Welcome to Ayo...');
- X`09writeln;
- X`09writeln('0) Quit.');
- X`09writeln('1) Background notes and rules. (Provided by H. F. Stahlke... tha
- Vnx!)');
- X`09writeln('2) Instructions for using this computer version.');
- X`09writeln('3) Play Ayo.');
- X`09writeln;
- X`09repeat
- X`09`09stat:=$qiow(chan:=iochan,func:=func,p1:=choice,p2:=1);
- X`09until choice in `5B'0','1','2','3','l','L'`5D;
- X`09if choice in `5B'l','L'`5D then
- X`09 begin
- X`09`09choice:='3';
- X`09`09logging:=true;
- X`09`09writeln('Logging has been turned on...');
- X`09 end;
- X`09case choice of
- X`09 '1':background_rules;
- X`09 '2':instructions;
- X`09 '3':begin
- X`09`09get_game_info;
- X`09`09play_the_game;
- X`09`09logging:=false;
- X`09 end;
- X`09end; (*case*)
- Xuntil choice='0';
- Xend.
- $ CALL UNPACK AYO.PAS;3 387232624
- $ v=f$verify(v)
- $ EXIT
- --
- Matt Stum Gwydion ap Myrddin Ball State University
- 00mjstum@leo.bsuvc.bsu.edu Shire of Afonlyn, MK Muncie, IN USA
-