1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| program QuatreVingtetUn;
Uses crt;
Var
compt,jeuxj,err :integer;
jeux,K :string [4];
Const
{TABLEAU DES COMBINES DU 421 EN MODE TEXTE}
combin : Array [1..432] of string[3] =
(
'111,','7','112','222','113','333','114','444','115','555','116','666',
'121','222','122','0','123','2','124','8','125','1','126','1','131',
'333','132','2','133','1','134','1','135','1','136','1','141','444','142',
'8','143','1','144','1','145','1','146','1','151','555','152','1','153',
'1','154','1','155','1','156','1','161','666','162','1','163','1','164',
'1','165','1','166','1',
'211','222','212','0','213','2','214','8','215','1','216','1','221','0',
'222','22','223','1','224','1','225','1','226','1','231','2','232','1',
'233','1','234','2','235','1','236','1','241','8','242','1','243','2',
'244','1','245','1','246','1','251','1','252','1','253','1','254','1',
'255','1','256','1','261','1','262','1','263','1','264','1','265','1',
'266','1',
'311','333','312','2','313','1','314','1','315','1','316','1','321','2',
'322','1','323','1','324','2','325','1','326','1','331','1','332','1',
'333','33','334','1','335','1','336','1','341','1','342','2','343','1',
'344','1','345','2','346','1','351','1','352','1','353','1','354','2',
'355','1','356','1','361','1','362','1','363','1','364','1','365','1',
'366','1',
'411','444','412','8','413','1','414','1','415','1','416','1','421','8',
'422','1','423','2','424','1','425','1','426','1','431','1','432','2',
'433','1','434','1','435','2','436','1','441','1','442','1','443','1',
'444','44','445','1','446','1','451','1','452','1','453','2','454','1',
'455','1','456','2','461','1','462','1','463','1','464','1','465','2',
'466','1',
'511','555','512','1','513','1','514','1','515','1','516','1','521','1',
'522','1','523','1','524','1','525','1','526','1','531','1','532','1',
'533','1','534','2','535','1','536','1','541','1','542','1','543','2',
'544','1','545','1','546','2','551','1','552','1','553','1','554','1',
'555','55','556','1','561','1','562','1','563','1','564','2','565','1',
'566','1',
'611','666','612','1','613','1','614','1','615','1','616','1','621','1',
'622','1','623','1','624','1','625','1','626','1','631','1','632','1',
'633','1','634','1','635','1','636','1','641','1','642','1','643','1',
'644','1','645','2','646','1','651','1','652','1','653','1','654','2',
'655','1','656','1','661','1','662','1','663','1','664','1','665','1',
'666','66');
begin
jeux :='421'; {arbitrairement pour le test}
for compt := 1 to 432 do
if combin[compt] = jeux then val(jeux,jeuxj,err);
{jeux est retraduit en chiffres dans la variable jeuxj}
ClrScr;
GotoXY(10,10);
WriteLn(jeuxj);
K := ReaDKey;
end. |
Partager