Sudoku Game Design Language (SGDL) Sijue Tan Rongzheng Yan Yu Shao Yigang Zhang William Chan Sudoku Game & Grid Games.
Download
Report
Transcript Sudoku Game Design Language (SGDL) Sijue Tan Rongzheng Yan Yu Shao Yigang Zhang William Chan Sudoku Game & Grid Games.
Sudoku Game Design Language
(SGDL)
Sijue Tan
Rongzheng Yan
Yu Shao
Yigang Zhang
William Chan
Sudoku Game & Grid Games
Introduction
Overview
Language for Sudoku fans and Programmer
Generate Sudoku games
Or any Grid games
Motivation
To present a language that can define rules of
Grid game and generate the game.
To attract people into a logic-reasoning way of
thinking
Features
What we can do
What we cannot do
Introduction
Architecture
Scanner
Strg
Chkg
str
Token
Bytecode Action
Parser
AST of
SGDL
Compiler
Bytecode
Lit
Gcol
Grow
Sfp
Execute
SGDL PrintOut
1*2*3*6*5
6*5*3*2*1
6*1*2*3*4
5*2865*58
6*5*2*1*7
Tech we used
Tech we used
Programming Language
perspective
Stack and Grid
[“0”]
(value, bool)
30
2048
81
Sample
Generate random Sudoku whole
solution
Cover some number of the grid
Sample Program
•
Array num;
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
main()
/*Entry point of SGDL program*/
begin
int i; int j;int k; int a; int col; int ran; /*Local declaration*/
string s;
Array tempt1;
num ~ [|1,2,3,4,5,6,7,8,9|];
/*Assignment*/
for (i~1;i<10;i++)
begin
Grid.Cell(1,i) ~ generateNum(1,i); /*Grid object*/
end
printg();
print(Grid.Cell(1,1));
for(j~2;j<10;j++)
/*Nested for loops*/
begin
for (k~1;k<10;k++)
begin
/*global variable declaration*/
Sample Program
•
•
•
•
•
•
•
•
•
•
•
•
•
•
if(k=9)
begin
Grid.Cell(j,9) ~ Grid.Cell(j-1,1);
end
else
begin
Grid.Cell(j,k) ~ Grid.Cell(j-1,k+1);
end
end
end
tempt1 ~ Grid.Row(2);
Grid.Row(2) ~ Grid.Row(4);
Grid.Row(4) ~tempt1;
printg();
/*If condition statement*/
/*row exchange*/
/*print out the whole grid*/
Developing Process-Tools
Developing Process
Test
Different aspects
Operators +-*/ ~
Functions
Data structures array grid
Sample program
Auto test
Makefile
Test.sh
Problems and Solutions
Developing Process
What we will do
User input
User interface
Other grid game
Cross word
Non-rectangle grid
Lesson Learned
Team cooperation
share ideas
Team schedule
Or any Grid games
O’caml is different but it is fun to
study!
Tools for software developing
Google Docs
Google Codes (SVN)
Another Attempt
Java AST
Generate java code