Sebagagai orang yang hidup di zaman ini, kita sudah tidak asing lagi dengan yang namanya game atau permainan pada komputer atau gadget. Hampir setiap kalangan dari anak-anak sampai dewasa pasti sudah mengenal yang namanya games. Di sini kami dari kelompok 37 mencoba untuk membuat game yang tidak hanya menghibur namun juga mengasah kemampuan otak. Nama gamenya adalah Sudoku37.
Tujuan :
Untuk menghibur sekaligus mengasah kemampuan otak dari pengguna.
Sasaran :
Semua kalangan, baik anak-anak sampai orang dewasa.
Deskripsi :
Game Sudoku37 adalah game yang tidak jauh beda dengan games-games sudoku lainnya.
Header:
Algoritma game_sudoku
{ ProgramPembuatanGameSudoku }
Deklarasi:
dnumber, dcode, play=1, wrong=0 : integer
play_again, instruksi :string
play_again, instruksi :string
Deskripsi:
Begin
Println ( “Welcome to Sudoku37“
);
Println ( “1.Play“);
Println (“2.Help”);
Println (“3.Quit”);
Println ( “
Select : “);
Read(“Instruksi”);
case (Instruksi);
‘2’ :
writeln ( “How to Play?At the beginning, the puzzle
provides a partially completed grid, "which typically has a unique solution. The objective is to fil
a grid with digits so that each column, each
row, and each of the regions contains all of the digits from 1 to the
number of the grid size. The same number must not appear twice in the same row,
column or in any of regions. ");
break;
‘3’
:
Println ( “Thanks for playing!:)”);
break;
break;
‘1’:
Play β 1 do
writeln ("Enter the code of box that you would like to contents: ");
read (dcode);
if dcode = 1
then writeln ("Insert the number (1,2,3,4) : “);
read (dnumber);
if dnumber = 2
then repeat dcode;
else if dnumber =/ 2
then write (“wrong number! try again”);
Println ("Kesalahan : "+wrong);
repeat dnumber;
endif
Play β 1 do
writeln ("Enter the code of box that you would like to contents: ");
read (dcode);
if dcode = 1
then writeln ("Insert the number (1,2,3,4) : “);
read (dnumber);
if dnumber = 2
then repeat dcode;
else if dnumber =/ 2
then write (“wrong number! try again”);
Println ("Kesalahan : "+wrong);
repeat dnumber;
endif
else if dcode =2
then writeln ("Insert the number (1,2,3,4) : “);
read (dnumber);
if dnumber = 4
then repeat dcode;
else if dnumber =/4
then write (“wrong number! try again”);
Println ("Kesalahan : "+wrong);
repeat dnumber;
endif
then writeln ("Insert the number (1,2,3,4) : “);
read (dnumber);
if dnumber = 4
then repeat dcode;
else if dnumber =/4
then write (“wrong number! try again”);
Println ("Kesalahan : "+wrong);
repeat dnumber;
endif
else if dcode =3
then writeln ("Insert the number (1,2,3,4) : “);
read (dnumber);
if dnumber = 3
then repeat dcode;
else if dnumber =/ 3
then write (“wrong number! try again”);
Println ("Kesalahan : "+wrong);
repeat dnumber;
endif
then writeln ("Insert the number (1,2,3,4) : “);
read (dnumber);
if dnumber = 3
then repeat dcode;
else if dnumber =/ 3
then write (“wrong number! try again”);
Println ("Kesalahan : "+wrong);
repeat dnumber;
endif
else if dcode =4
then writeln ("Insert the number (1,2,3,4) : “);
read (dnumber);
if dnumber = 2
then repeat dcode;
else if dnumber =/2
then write (“wrong number! try again”);
Println ("Kesalahan : "+wrong);
repeat dnumber;
endif
then writeln ("Insert the number (1,2,3,4) : “);
read (dnumber);
if dnumber = 2
then repeat dcode;
else if dnumber =/2
then write (“wrong number! try again”);
Println ("Kesalahan : "+wrong);
repeat dnumber;
endif
else if dcode =5
then writeln ("Insert the number (1,2,3,4) : “);
read (dnumber);
if dnumber = 4
then repeat dcode;
else if dnumber =/ 4
then write (“wrong number! try again”);
Println ("Kesalahan : "+wrong);
repeat dnumber;
endif
then writeln ("Insert the number (1,2,3,4) : “);
read (dnumber);
if dnumber = 4
then repeat dcode;
else if dnumber =/ 4
then write (“wrong number! try again”);
Println ("Kesalahan : "+wrong);
repeat dnumber;
endif
else if dcode =6
then writeln ("Insert the number (1,2,3,4) : “);
read (dnumber);
if dnumber = 2
then writeln (“congratulatios!the puzzle is solved”);
("Total Kesalahan Anda : "+wrong);
if( wrong <= 1 )
then writeln ("Insert the number (1,2,3,4) : “);
read (dnumber);
if dnumber = 2
then writeln (“congratulatios!the puzzle is solved”);
("Total Kesalahan Anda : "+wrong);
if( wrong <= 1 )
Println ("Excellent!");
else if(( wrong >= 2) && ( wrong <= 4))
Println ("Good!");
else if( wrong >= 5)
Println ("Poor!");
write (“do you wanna play again?”);
read (play_again);
if play_again= N
then Play β 0
Println (“thanks for playing!”);
else if dnumber =/ 2
then write (“wrong number! try again”);
repeat dnumber;
endif
write (“do you wanna play again?”);
read (play_again);
if play_again= N
then Play β 0
Println (“thanks for playing!”);
else if dnumber =/ 2
then write (“wrong number! try again”);
repeat dnumber;
endif
while (Play β 1)
endwhile
endwhile
break;
endcase
End
End
Penjelasan :
1. Dalam deklarasi terdapat dnumber, dcode, play=1, wrong=0 yang merupakan tipe data integer,
play_again, instruksi : string. Terdapat tipe data int untuk data inputan si pengguna yang bersifat bilangan bulat.
play_again, instruksi : string. Terdapat tipe data int untuk data inputan si pengguna yang bersifat bilangan bulat.
2. Pada : writeln ("Enter the code of box that you would like to contents: ");
read (dcode);
Si pengguna menginput dcode yang merupakan code dari kolom yang akan diisi angka oleh si pengguna.
Flowchart :
Console :
Tidak ada komentar:
Posting Komentar