2 signal WIN1, WIN2, WIN3, PLEIN;
\r
4 UNIT INCHAR : IIuwgraph function : integer;
\r
8 if i <> 0 then exit fi;
\r
13 UNIT INIT_GRAPH : procedure;
\r
15 pref iiuwgraph block
\r
21 (* DEFINIT LES 27 ZONES ACTIVE DE L'ECRAN
\r
22 OU L'ON PEUT CLIQUER A LA SOURIS *)
\r
24 UNIT MOUSEPOS : function : integer;
\r
26 pressed, l, r, c : boolean;
\r
32 call getpress(0,x,y,b,l,r,c);
\r
34 if ((x>110) and (x<130))
\r
35 then if ((y>290) and (y<310)) then result := 1; exit fi;
\r
36 if ((y>190) and (y<210)) then result := 11; exit fi;
\r
37 if ((y>090) and (y<110)) then result := 21; exit fi;
\r
39 if ((x>260) and (x<280))
\r
40 then if ((y>290) and (y<310)) then result := 2; exit fi;
\r
41 if ((y>190) and (y<210)) then result := 12; exit fi;
\r
42 if ((y>090) and (y<110)) then result := 22; exit fi;
\r
44 if ((x>410) and (x<430))
\r
45 then if ((y>290) and (y<310)) then result := 3; exit fi;
\r
46 if ((y>190) and (y<210)) then result := 13; exit fi;
\r
47 if ((y>090) and (y<110)) then result := 23; exit fi;
\r
49 if ((x>160) and (x<180))
\r
50 then if ((y>250) and (y<270)) then result := 4; exit fi;
\r
51 if ((y>150) and (y<170)) then result := 14; exit fi;
\r
52 if ((y>050) and (y<070)) then result := 24; exit fi;
\r
54 if ((x>310) and (x<330))
\r
55 then if ((y>250) and (y<270)) then result := 5; exit fi;
\r
56 if ((y>150) and (y<170)) then result := 15; exit fi;
\r
57 if ((y>050) and (y<070)) then result := 25; exit fi;
\r
59 if ((x>460) and (x<480))
\r
60 then if ((y>250) and (y<270)) then result := 6; exit fi;
\r
61 if ((y>150) and (y<170)) then result := 16; exit fi;
\r
62 if ((y>050) and (y<070)) then result := 26; exit fi;
\r
64 if ((x>210) and (x<230))
\r
65 then if ((y>210) and (y<230)) then result := 7; exit fi;
\r
66 if ((y>110) and (y<130)) then result := 17; exit fi;
\r
67 if ((y>010) and (y<030)) then result := 27; exit fi;
\r
69 if ((x>360) and (x<380))
\r
70 then if ((y>210) and (y<230)) then result := 8; exit fi;
\r
71 if ((y>110) and (y<130)) then result := 18; exit fi;
\r
72 if ((y>010) and (y<030)) then result := 28; exit fi;
\r
74 if ((x>510) and (x<530))
\r
75 then if ((y>210) and (y<230)) then result := 9; exit fi;
\r
76 if ((y>110) and (y<130)) then result := 19; exit fi;
\r
77 if ((y>010) and (y<030)) then result := 29; exit fi;
\r
85 (* STRUCTURE DEFINISSANT 3 CASES (BOX) ALIGNEES DANS LE CUBE *)
\r
87 UNIT LIGNE : class(tab_nb : arrayof integer);
\r
88 var suiv, pred : ligne,
\r
89 occur : arrayof box,
\r
92 UNIT box : class(nb : integer);
\r
101 array occur dim(1:3);
\r
102 for i := 1 to 3 do occur(i) := new box(tab_nb(i)) od
\r
105 (* LISTE DOUBLEMENT CHAINEE : POSSIBILITES D'UN JOUEUR *)
\r
108 var tactik,fin : ligne;
\r
110 UNIT VIDE : function : boolean;
\r
112 result := tactik = NONE
\r
115 UNIT DELPOSS : procedure;
\r
118 if vide then exit fi;
\r
119 call supprimer(tactik);
\r
123 UNIT SUPPRIMER : procedure(e : ligne);
\r
128 tactik:=tactik.suiv;
\r
140 aux := tactik.suiv;
\r
144 aux.pred.suiv := aux.suiv;
\r
145 aux.suiv.pred := aux.pred;
\r
154 UNIT AJOUTER : procedure(e : ligne);
\r
157 if vide then tactik,fin := e
\r
158 else fin.suiv := e;
\r
165 UNIT ELEMENT : class;
\r
166 var tab : arrayof integer,
\r
172 (* PILE D'ELEMENTS : LISTE DE TOUTES LES SOLUTIONS POUR UNE CASE DONNEE *)
\r
175 var tete : element;
\r
177 UNIT PILEVIDE : function : boolean;
\r
179 result := tete = NONE
\r
182 UNIT EMPILER : procedure(e : element);
\r
184 if not pilevide then e.suivant := tete fi;
\r
188 UNIT DEPILER : function : element;
\r
192 if not pilevide then tete := tete.suivant fi
\r
195 UNIT DELPILE : procedure;
\r
198 do if pilevide then exit fi;
\r
200 tete := tete.suivant;
\r
206 (* LISTE DE NUMEROS DE CASE A NE PAS JOUER *)
\r
208 UNIT LISTE : class;
\r
209 var tete, queue : numero;
\r
211 UNIT NUMERO : class(val : integer);
\r
215 UNIT LISTEVIDE : function : boolean;
\r
217 if tete = NONE then result := true fi
\r
220 UNIT AJOUT : procedure(e : integer);
\r
223 if listevide then tete, queue := new numero(e)
\r
224 else aux := new numero(e);
\r
230 UNIT MEMBER : function(e : integer) : boolean;
\r
233 if listevide then exit fi;
\r
235 do if aux = NONE then exit fi;
\r
236 if aux.val = e then result := true;
\r
238 else aux := aux.next
\r
243 UNIT DELLISTE : procedure;
\r
246 do if listevide then exit fi;
\r
254 (* INITIALISATION DU CUBE MATERIALISE PAR UN TABLEAU A TROIS DIMENSIONS *)
\r
257 var i, j, k : integer,
\r
258 chape : arrayof arrayof arrayof integer;
\r
261 array chape dim (1:3);
\r
264 array chape(i) dim (1:3)
\r
270 array chape(j,k) dim (1:3)
\r
275 (* TRANSFORME UN ENTIER X (0 < X < 28) EN COORDONNEES DU CUBE I,J,K *)
\r
276 UNIT INT_COORD : procedure (val : integer; output i, j, k : integer);
\r
278 k := (val div 10)+1;
\r
279 i := (((val mod 10)-1) div 3)+1;
\r
280 j := (((val mod 10)-1) mod 3)+1;
\r
283 (* MISE A JOUR DU TABLEAU DES COUPS OPTIMUMS *)
\r
285 UNIT MAJTOP : procedure(topcoup : arrayof integer);
\r
289 for i := 1 to 29 do topcoup(i) := 0 od;
\r
290 lig := jeu1.tactik;
\r
292 if lig = NONE then exit fi;
\r
295 if (not(lig.occur(i).flag) and (MDJ.disponible(lig.occur(i).no)))
\r
296 then topcoup(lig.occur(i).no) := topcoup(lig.occur(i).no) + 1
\r
303 (* MISE A JOUR DES LISTES DOUBLEMENT CHAINEES EN FONCTION DU COUPS JOUE *)
\r
305 UNIT MAJJEU : procedure (poss1 : poss);
\r
309 i, pasbon : integer,
\r
310 identique, good : boolean;
\r
312 if MDJ.premier then pasbon := 2;
\r
318 if pile_sol.pilevide then exit fi;
\r
319 sol := pile_sol.depiler;
\r
320 lig := poss1.tactik;
\r
322 if lig = NONE then exit fi;
\r
325 do if lig.occur(i).no = clic then lig.occur(i).flag := true fi;
\r
326 if lig.occur(i).no <> sol.tab(i)
\r
327 then identique := false
\r
330 if identique then exit fi;
\r
338 if MDJ.joue(sol.tab(i)) = pasbon
\r
345 nouv := new ligne(sol.tab);
\r
346 call poss1.ajouter(nouv);
\r
348 do if ((MDJ.joue(poss1.fin.occur(i).no) <> 0) or
\r
349 (poss1.fin.occur(i).no = clic))
\r
350 then poss1.fin.occur(i).flag := true
\r
356 lig := poss2.tactik;
\r
358 if lig = NONE then exit fi;
\r
360 do if lig.occur(i).no = clic
\r
363 call poss2.supprimer(lig);
\r
365 else nouv := lig.suiv
\r
372 UNIT ERREURCLIC : procedure;
\r
374 pref iiuwgraph block
\r
379 call outstring("Cher utilisateur,");
\r
380 call move (100,100);
\r
381 call outstring("Vous ne pouvez jouer que sur des cases marrons !");
\r
382 call move(400,340);
\r
384 call outstring("< Appuyez sur une touche >");
\r
390 call getpress(0,xm,ym,b,l,r,c);
\r
391 if l then l := false;
\r
392 call setposition(xm+20,ym+20);
\r
396 if i<>0 then exit fi
\r
403 (* LE MAITRE DU JEU *)
\r
405 UNIT ARBITRE : class;
\r
407 (* DESSINE LE CUBE EN MODE GRAPHIQUE *)
\r
408 UNIT INIT_AFFCUBE : procedure;
\r
409 var i, j , k, x, y, couleur : integer;
\r
411 pref iiuwgraph block
\r
413 x := 120; y := 300;
\r
416 call draw(x,y-200); call draw(x+300,y-200);
\r
417 call draw(x+300,y); call draw(x,y);
\r
418 y := y-200; call move(x,y);
\r
419 call draw(x+100,y-75); call draw(x+400,y-75); call draw(x+300,y);
\r
420 call move(x+400,y-75);
\r
421 call draw(x+400,y+125); call draw(x+300,y+200);
\r
422 y := y+200; call move(x+350,y-37);
\r
423 call draw(x+350,y-237); call draw(x+50,y-237);
\r
424 call move(x+150,y);
\r
425 call draw(x+150,y-200); call draw(x+250,y-275);
\r
426 call move(x,y-100);
\r
427 call draw(x+300,y-100); call draw(x+400,y-175);
\r
428 call style(5); call move(x,y);
\r
429 call draw(x+100,y-75); call draw(x+100,y-275);
\r
430 call move(x+100,y-75); call draw(x+400,y-75);
\r
431 call move(x+350,y-37);
\r
432 call draw(x+50,y-37); call draw(x+50,y-237);
\r
433 call move(x+150,y);
\r
434 call draw(x+250,y-75); call draw(x+250,y-275);
\r
435 call move(x,y-100);
\r
436 call draw(x+100,y-175); call draw(x+400,y-175);
\r
437 call move(x+200,y-37); call draw(x+200,y-237);
\r
438 call move(x+50,y-137); call draw(x+350,y-137);
\r
439 call move(x+150,y-100); call draw(x+250,y-175);
\r
444 do if k > 1 then call color(15); couleur := 15 fi;
\r
447 do x := 120+(j-1)*150+(i-1)*50;
\r
448 y := 300-((k-1)*100+(i-1)*37);
\r
449 call cirb(x, y, 3, 0.0, 0.0, couleur, couleur, 1, 1);
\r
456 (* AFFICHE SUR LE CUBE L'ENDROIT OU A ETE JOUE LE COUPS *)
\r
457 UNIT AFFCOUPS : procedure(i,j,k : integer);
\r
458 var x, y : integer;
\r
460 pref iiuwgraph block
\r
462 x := 120+(j-1)*150+(i-1)*50;
\r
463 y := 300-((k-1)*100+(i-1)*37);
\r
464 x := x-3; y := y-4;
\r
466 if MDJ.premier then call color(12)
\r
467 else call color(10)
\r
469 call outstring("Û");
\r
470 call move(x-5,y-3);
\r
471 call draw(x+12,y-3); call draw(x+12,y+10);
\r
472 call draw(x-5,y+10); call draw(x-5,y-3);
\r
477 (* INITIALISATION DES 13 FACES CONTENUES DANS LE CUBE :
\r
478 ASSOCIATION DE 9 NUMEROS DE CASES POUR CHACUNE D'ELLES *)
\r
480 UNIT INIT_FACES : procedure;
\r
481 var i, j, k, t : integer;
\r
483 array face dim(1:13);
\r
485 do array face(i) dim(1:9)
\r
488 do face (1,i) := i;
\r
489 face (2,i) := i+10;
\r
490 face (3,i) := i+20;
\r
491 face (12,i) := 3*i;
\r
495 do face (3+i, j) := i+3*(j-1);
\r
496 face (3+i,j+3) := i+10+3*(j-1);
\r
497 face (3+i,j+6) := i+20+3*(j-1);
\r
504 do face (i,j+3*(t-1)) := k;
\r
511 do face (10,i) := i;
\r
512 face (10,i+3) := i+13;
\r
513 face (10,i+6) := i+26;
\r
516 do face (11,i) := i+6;
\r
517 face (11,i+3) := i+13;
\r
518 face (11,i+6) := i+20;
\r
521 do face (13,i) := 1+3*(i-1);
\r
522 face (13,i+3) := face (13,i)+11;
\r
523 face (13,i+6) := face (13,i)+22;
\r
527 (* CREATION DU MASQUE POUR TROUVER TOUTES LES SOLUTIONS SELON UNE CASE *)
\r
528 UNIT INIT_MASK : procedure;
\r
531 array mask dim(1:8);
\r
533 do array mask(i) dim(1:3) od;
\r
534 for i := 1 to 3 do mask(1,i) := i od;
\r
535 for i := 1 to 3 do mask(2,i) := i+3 od;
\r
536 for i := 1 to 3 do mask(3,i) := i+6 od;
\r
537 for i := 1 to 3 do mask(4,i) := 1+3*(i-1) od;
\r
538 for i := 1 to 3 do mask(5,i) := 2+3*(i-1) od;
\r
539 for i := 1 to 3 do mask(6,i) := 3+3*(i-1) od;
\r
540 for i := 1 to 3 do mask(7,i) := 1+4*(i-1) od;
\r
541 for i := 1 to 3 do mask(8,i) := 2*i+1 od;
\r
544 (* EMPILE TOUTES LES SOLUTIONS SELON UNE CASE CHOISIE *)
\r
545 UNIT SOLUTIONS : procedure(nobox : integer);
\r
546 var i, j, k, l, m,z : integer,
\r
549 call pile_sol.delpile;
\r
552 do if face(i,j) = nobox
\r
553 then for k := 1 to 8
\r
555 do if mask(k,l) = j
\r
560 e.tab(m) := face(i,mask(k,m)) od;
\r
561 call pile_sol.empiler(e);
\r
570 (* INDIQUE SI LA CASE CHOISIE PAR UN JOUEUR EST ACCESSIBLE OU NON *)
\r
571 UNIT DISPONIBLE : function (choix : integer) : boolean;
\r
572 var i, j, k : integer;
\r
575 call int_coord(choix,i,j,k);
\r
576 if dispo(i,j) = choix then result := true fi
\r
579 (* MISE A JOUR DE LA MATRICE CONTENANT TOUTES LES CASE DISPONIBLES.
\r
580 CHANGEMENT DE COULEUR POUR LE PION SITUE AU DESSUS DU COUPS JOUE *)
\r
582 UNIT MAJDISPO : procedure(i, j ,k : integer);
\r
583 var x, y, h, c, l : integer;
\r
585 dispo(i,j) := dispo(i,j)+10;
\r
586 pref iiuwgraph block
\r
589 then dispo(i,j) := 0
\r
590 else call int_coord(dispo(i,j), c, l, h);
\r
591 x := 120+(l-1)*150+(c-1)*50;
\r
592 y := 300-((h-1)*100+(c-1)*37);
\r
594 call cirb(x, y, 3, 0.0, 0.0, 6, 6, 1, 1);
\r
599 (* RENVOIE, POUR UNE CASE DONNEE, LE NUMERO DU JOUEUR QUI A JOUE DESSUS *)
\r
600 UNIT JOUE : function(endroit : integer) : integer;
\r
601 var i, j, k : integer;
\r
603 call int_coord(endroit, i, j, k);
\r
604 result := cube.chape(i,j,k)
\r
607 (* MISE A JOUR DES NUMEROS DU CUBE POUR SAVOIR QUI A JOUE A QUEL ENDROIT.
\r
608 POR SAVOIR SI LE CUBE EST PLEIN OU SI UN JOUEUR A GAGNE *)
\r
610 UNIT MAJCUBE : function(i, j, k : integer; nojoueur : boolean) : integer;
\r
611 var m, n : integer,
\r
612 x, y, x1, y1, z1, x2, y2, z2 : integer,
\r
619 if nojoueur then cube.chape(i, j, k) := 1;
\r
620 else cube.chape(i, j, k) := 2
\r
624 do if cube.chape(m,n,3) = 0
\r
625 then pasfini := true;
\r
630 if not pasfini then result := FINI fi;
\r
631 if MDJ.premier then poss1 := jeu1
\r
634 aux := poss1.tactik;
\r
636 while ((aux <> NONE) and (not pasfini))
\r
637 do if (aux.occur(1).flag AND
\r
638 aux.occur(2).flag AND
\r
640 then pref iiuwgraph block
\r
643 call int_coord(aux.occur(1).no,x1,y1,z1);
\r
644 call int_coord(aux.occur(3).no,x2,y2,z2);
\r
645 x := 120+(y1-1)*150+(x1-1)*50;
\r
646 y := 300-((z1-1)*100+(x1-1)*37);
\r
648 x := 120+(y2-1)*150+(x2-1)*50;
\r
649 y := 300-((z2-1)*100+(x2-1)*37);
\r
654 else aux := aux.suiv
\r
658 result := GAGNE fi;
\r
661 (* DECLARATIONS DES VARIABLES DE L'ARBITRE *)
\r
662 const GAGNE = 1, FINI = 2;
\r
664 face, mask : arrayof arrayof integer,
\r
668 resultat : integer,
\r
674 (* LE MAITRE DE JEU ENGAGE LA PARTIE *)
\r
676 UNIT START_GAME : procedure;
\r
678 pref iiuwgraph block
\r
680 pile_sol := new pile;
\r
681 listdef := new liste;
\r
686 array dispo dim(1:3);
\r
688 do array dispo(i) dim(1:3);
\r
689 for j := 1 to 3 do dispo(i,j) := i*3+j-3 od
\r
693 call move(100,320);
\r
696 then call outstring("Choisissez la premi
\8are case du joueur ROUGE");
\r
697 else call outstring("Choisissez la premi
\8are case pour l'ORDINATEUR")
\r
699 joueur1 := new strat1;
\r
700 if disponible(clic) then exit fi;
\r
704 call int_coord(clic, x, y, z);
\r
705 call solutions(clic);
\r
706 i := majcube(x,y,z,premier);
\r
707 call majdispo(x, y, z);
\r
709 call affcoups(x,y,z);
\r
710 premier := not premier;
\r
712 call move(100,320);
\r
716 call outstring("Choisissez la premi
\8are case du joueur VERT ");
\r
717 joueur2 := new strat2;
\r
718 if disponible(clic) then exit fi;
\r
722 call outstring(" ");
\r
723 call move(100,320);
\r
725 call outstring("Votre choix ? ");
\r
726 joueur3 := new user;
\r
727 if disponible(clic) then exit fi;
\r
732 call move(100,320);
\r
733 call outstring(" ");
\r
734 call int_coord(clic, x, y, z);
\r
735 call solutions(clic);
\r
736 i := majcube(x,y,z,premier);
\r
737 call majdispo(x, y, z);
\r
739 call affcoups(x, y, z);
\r
740 premier := not premier;
\r
743 if premier then attach(joueur1)
\r
744 else if nbjoueur then attach(joueur2)
\r
745 else attach(joueur3)
\r
748 if disponible(clic) then exit fi;
\r
750 call int_coord(clic, x, y, z);
\r
751 resultat := majcube(x, y, z, premier);
\r
752 call affcoups(x, y, z);
\r
753 if resultat = GAGNE
\r
754 then if premier then raise WIN1
\r
755 else if nbjoueur then raise WIN2
\r
760 if resultat = FINI then raise PLEIN fi;
\r
761 call majdispo(x, y, z);
\r
762 premier := not premier;
\r
764 lastwill : call move(70,340);
\r
766 call outstring("Arbitre : Belle partie n'est-ce pas ?");
\r
767 call move (410,340);
\r
769 call outstring("< Appuyez sur une touche >");
\r
776 call getpress(0,xm,ym,b,l,r,c);
\r
777 if l then l := false;
\r
778 call setposition(xm+20,ym+20);
\r
782 if i<>0 then exit fi
\r
784 if driver then call hidecursor fi
\r
791 (* STRATEGIE COMMUNE AUX DEUX JOUEURS : ATTAQUE OU DEFENSE IMMEDIATE *)
\r
793 UNIT STRATEGIE : procedure(output priorite : boolean);
\r
794 var nb_flag,i : integer,
\r
796 poss1, poss2 : poss;
\r
798 if MDJ.premier then poss1 := jeu1;
\r
800 else poss1 := jeu2;
\r
804 lig := poss1.tactik;
\r
806 if lig = NONE then exit fi;
\r
809 do if lig.occur(i).flag then nb_flag := nb_flag+1 fi
\r
812 then for i := 1 to 3
\r
813 do if not lig.occur(i).flag then exit fi
\r
815 if MDJ.disponible(lig.occur(i).no)
\r
816 then priorite := true;
\r
817 clic := lig.occur(i).no;
\r
825 lig := poss2.tactik;
\r
826 call listdef.delliste;
\r
828 if lig = NONE then exit fi;
\r
831 do if lig.occur(i).flag then nb_flag := nb_flag+1 fi od;
\r
836 if not lig.occur(i).flag then exit fi
\r
838 if MDJ.disponible(lig.occur(i).no)
\r
841 clic := lig.occur(i).no;
\r
843 else call listdef.ajout(lig.occur(i).no-10);
\r
851 (* STRATEGIE D'ATTAQUE DU JOUEUR 1 *)
\r
853 UNIT STRAT1 : coroutine;
\r
854 var trouve,priorite : boolean,
\r
855 i, j, k, max, imax, min : integer;
\r
860 if driver then clic := mousepos
\r
866 call strategie(priorite);
\r
867 if not priorite then
\r
868 call majtop(topcoups1);
\r
869 for i := 29 downto 1
\r
870 do if ((topcoups1(i) > max) and (not listdef.member(i)))
\r
872 max := topcoups1(i);
\r
883 if ((dispo(i,j) < min) and (dispo(i,j) > 0))
\r
884 then min := dispo(i,j)
\r
891 call MDJ.solutions(clic);
\r
893 call int_coord(clic, i, j, k);
\r
894 max := MDJ.majcube(i, j, k, MDJ.premier);
\r
899 (* STRATEGIE DE DEFENSE DU JOUEUR 2 *)
\r
901 UNIT STRAT2 : coroutine;
\r
902 var trouve, priorite : boolean,
\r
903 i, j, k, max, imax : integer;
\r
908 if driver then clic := mousepos
\r
914 call strategie(priorite);
\r
915 if not priorite then
\r
916 call majtop(topcoups1);
\r
917 for i := 29 downto 1
\r
918 do if ((topcoups1(i) > max) and (not listdef.member(i)))
\r
920 max := topcoups1(i);
\r
931 if dispo(i,j) > max
\r
932 then max := dispo(i,j)
\r
939 call MDJ.solutions(clic);
\r
941 call int_coord(clic, i, j, k);
\r
942 max := MDJ.majcube(i, j, k, MDJ.premier);
\r
947 (* CAS OU L'UTILISATEUR EST LE JOUEUR 2 *)
\r
949 UNIT USER : coroutine;
\r
950 var i, j, k, max : integer;
\r
954 if driver then clic := mousepos
\r
959 pref iiuwgraph block
\r
962 call move(100,320);
\r
963 call outstring(" ");
\r
964 call move(100,320);
\r
966 call outstring("Votre choix ? ");
\r
970 if driver then clic := mousepos
\r
974 if MDJ.disponible(clic) then exit fi;
\r
977 call move(100,320);
\r
978 call outstring(" ");
\r
979 call MDJ.solutions(clic);
\r
981 call int_coord(clic, i, j, k);
\r
982 max := MDJ.majcube(i, j, k, MDJ.premier);
\r
988 (* DECLARATIONS DES VARIABLES DU PROGRAMME PRINCIPAL *)
\r
989 var dispo : arrayof arrayof integer,
\r
992 topcoups2 : arrayof integer,
\r
999 driver, a, l, r, c : boolean;
\r
1001 (* TRAITEMENT DES SIGNAUX *)
\r
1003 when WIN1 : pref iiuwgraph block
\r
1005 call move(100,325);
\r
1007 call outstring("MA STRATEGIE D'ATTAQUE ETAIT IMPARABLE !");
\r
1011 when WIN2 : pref iiuwgraph block
\r
1013 call move(100,325);
\r
1015 call outstring("MA DEFENSE M'A MEME EMMENE A LA VICTOIRE !!!! ");
\r
1019 when WIN3 : pref iiuwgraph block
\r
1021 call move(80,325);
\r
1024 ("Bravo, vous venez de gagner contre un professionnel !!!! ");
\r
1028 when PLEIN : pref iiuwgraph block
\r
1030 call move(100,325);
\r
1032 call outstring("Le cube est plein, aucun joueur n'a gagn
\82");
\r
1038 write(chr(27),"[2J");
\r
1039 pref iiuwgraph block
\r
1044 driver := init(b);
\r
1046 call move (210,150);
\r
1048 call outstring("M O R P I O N 3 D");
\r
1049 call move(20,250);
\r
1051 call outstring("Voulez-vous jouer avec l'ordinateur (o/n) ?");
\r
1053 if b = 111 then nbjoueur := false;
\r
1055 call move(20,270);
\r
1056 call outstring("Vous
\88tes le joueur VERT.");
\r
1057 call move(360,340);
\r
1059 call outstring("< Appuyez sur une touche >");
\r
1063 call getpress(0,xm,ym,b,l,r,c);
\r
1064 if l then l := false;
\r
1065 call setposition(xm+20,ym+20);
\r
1069 if b<>0 then exit fi
\r
1071 else nbjoueur := true
\r
1076 array topcoups1 dim (1:29);
\r
1077 array topcoups2 dim (1:29);
\r
1078 mdj := new arbitre;
\r
1079 call mdj.start_game;
\r