code untuk membuat games tatarucingan, silakan copy code di bawah ini :
uses wincrt; label hasil,mulai,ulang;
var jawab : string;
n1,n2,n3,n4,n5,n6,n7,n8,n9,n10 :integer;
jumlah: integer;
pil,nama : string;
pil2:char;
simpan : text;
begin
repeat
{menu games}
{-------------------------------------------------------------------------------}
clrscr;
writeln('mohamad echa putra');
writeln('algoritma');
writeln;
gotoxy(25,5);writeln ('GAMES TATARUCINGAN ');
gotoxy(20,6);writeln('===============================');
gotoxy(25,8);write(' tekan enter : . . .');
readln;
clrscr;
gotoxy(25,5);writeln ('GAMES TATARUCINGAN ');
gotoxy(20,6);writeln('===============================');
gotoxy(25,7);write('masukan nama : ');readln(nama);
gotoxy(25,9);writeln('1. lanjut 2.keluar');
gotoxy(20,10);writeln('===============================');
gotoxy(25,11);write('pilih : ');readln(pil);
{*} if ( pil='1') then
begin
repeat
clrscr;
gotoxy(25,5);writeln('jawablah pertanyaan-pertanyaan tersebut dengan benar ');
gotoxy(25,6);writeln('cara menjawabnya seperti berikut : ');
gotoxy(25,8);writeln(' rambut apa yang bisa di makan :...(8 huruf) ');
gotoxy(25,9);writeln(' ...... ..');
gotoxy(25,10);writeln('jawab : rambut an');
gotoxy(25,11);writeln('===================================================');
gotoxy(25,12);write('apakah anda mengerti [Y/T] : ');readln(pil2);
until upcase(pil2)<>'Y';
clrscr;
writeln('1. mulai 2.keluar ');
write('pilih : ');readln(pil);
{***} if( pil='1') then
begin
goto mulai
{***}end
{***}else
begin
donewincrt;
{***}end;
mulai : writeln;
{----------------------------------------------------------------------------}
{memulai games }
{__________________________________________________________________________}
{soal 1}
clrscr;
gotoxy(25,3);writeln('1. HEWAN APA YANG BERSOUDARA : ... (12 huruf)');
gotoxy(25,4);writeln(' ..... .......');
gotoxy(25,5);write('jawab : ');readln(jawab);
if (jawab= 'KATAK BERADIK') or (jawab='katak beradik') then
begin
n1:=10;
end
else
begin
n1:=0;
goto hasil;
end;
{soal 2}
clrscr;
gotoxy(25,3);writeln('2. HEWAN APA YANG NAMANYA 2 HURUF:...(5 huruf) ');
gotoxy(25,4);writeln(' . ... .');
gotoxy(25,5);write('jawab : ');readln(jawab);
if (jawab= 'U DAN G') or (jawab='u dan g') then
begin
n2:=10;
end
else
begin
n2:=0;
goto hasil;
end;
{soal 3}
clrscr;
gotoxy(15,3);writeln('3. SIAPAKAH YANG POTONG RAMBUT TIAP HARI TAPI TIDAK BOTAK :...(13 huruf) ');
gotoxy(25,4);writeln(' ...... .......');
gotoxy(25,5);write('jawab : ');readln(jawab);
if (jawab= 'TUKANG PANGKAS') or (jawab='tukang pangkas') then
begin
n3:=10;
end
else
begin
n3:=0;
goto hasil;
end;
{soal 4}
clrscr;
gotoxy(25,3);writeln('4. GAJAH APA YANG BELALAINYA PENDEK :...(10 huruf) ');
gotoxy(25,4);writeln(' ..... .....');
gotoxy(25,5);write('jawab : ');readln(jawab);
if (jawab= 'GAJAH PESEK') or (jawab='gajah pesek') then
begin
n4:=10;
end
else
begin
n4:=0;
goto hasil;
end;
{soal 5}
clrscr;
gotoxy(25,3);writeln('5. BOLA APA YANG MIRIP KUCING :...(8 huruf) ');
gotoxy(25,4);writeln(' .... ....');
gotoxy(25,5);write('jawab : ');readln(jawab);
if (jawab= 'BOLA EMON') or (jawab='bola emon') then
begin
n5:=10;
end
else
begin
n5:=0;
goto hasil;
end;
{soal 6}
clrscr;
gotoxy(25,3);writeln('6. SIAPAKAH PRESIDEN RI YANG TERSEKSI :... (8 huruf ) ');
gotoxy(25,4);writeln(' .. .. ....');
gotoxy(25,5);write('jawab : ');readln(jawab);
if (jawab= 'PA HA BIBI') or (jawab='pa ha bibi') then
begin
n6:=10;
end
else
begin
n6:=0;
goto hasil;
end;
{soal 7}
clrscr;
gotoxy(25,3);writeln('7. NAIKNYA CEPET,TURUNNYA LAMBAT :... (5 huruf)');
gotoxy(25,4);writeln(' .....');
gotoxy(25,5);write('jawab : ');readln(jawab);
if (jawab= 'INGUS') or (jawab='ingus') then
begin
n7:=10;
end
else
begin
n7:=0;
goto hasil;
end;
{soal 8}
clrscr;
gotoxy(25,3);writeln('8. LEMARI APA YANG BISA MASUK KANTONG :... (8 huruf)');
gotoxy(25,4);writeln(' .... ....');
gotoxy(25,5);write('jawab : ');readln(jawab);
if (jawab= 'LEMA RIBU') or (jawab='lema ribu') then
begin
n8:=10;
end
else
begin
n8:=0;
goto hasil;
end;
{soal 9}
clrscr;
gotoxy(25,3);writeln('9. SANDAL APA YANG PALING ENAK :...(12huruf ) ');
gotoxy(25,4);writeln(' ...... ......');
gotoxy(25,5);write('jawab : ');readln(jawab);
if (jawab= 'SANDAL TERASI') or (jawab='sandal terasi') then
begin
n9:=10;
end
else
begin
n9:=0;
goto hasil;
end;
{soal 10}
clrscr;
gotoxy(25,3);writeln('10. ITEM,GEDE,BULUAN DAN MANIS :...(15 huruf) ');
gotoxy(25,4);writeln(' ....... ........ ');
gotoxy(25,5);write('jawab : ');readln(jawab);
if (jawab= 'MANISAN KINGKONG') or (jawab='manisan kingkong') then
begin
n10:=10;
end
else
begin
n10:=0;
goto hasil;
end;
{__________________________________________________________________________}
hasil : writeln;
jumlah:= n1+n2+n3+n4+n5+n6+n7+n8+n9+n10;
{simpan data ke file TXT}
{______________________________}
assign(simpan,'simpan.txt');
rewrite(simpan);
writeln(simpan,nama,' : ',jumlah);
close(simpan);
{___________________________}
clrscr;
{apabila games telah selesai}
{----------------------------------------------------------------}
if (jumlah>50) then
begin
gotoxy(25,3); writeln('selamat anda lulus');
gotoxy(25,5);writeln('____________________________________________');
gotoxy(25,6); writeln('nama | jumlah | ');
gotoxy(25,5);writeln('____________________________________________');
assign(simpan,'simpan.txt');
reset(simpan);
readln(simpan,nama);
gotoxy(25,9);writeln(nama);
close(simpan);
end
else
begin
gotoxy(25,3);writeln('maaf anda belum lulus, silakan anda coba lagi... :)');
gotoxy(25,5);writeln('____________________________________________');
gotoxy(25,6); writeln('nama | jumlah | ');
gotoxy(25,5);writeln('____________________________________________');
{|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
assign(simpan,'simpan.txt');
reset(simpan);
while not eof(simpan)do
begin
readln(simpan,nama);
gotoxy(25,7);writeln(nama);
end;
close(simpan);
end;
{||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
end
else
begin
donewincrt;
end;
gotoxy(25,8); write('apakah anda ingin mengulang lagi[Y/T] ');readln(pil2);
until upcase(pil2)<>'Y';
end.