Unformatted text preview:

Sudoku Game Design Language SGDL Language Reference Manual Team Members Sijue Tan st2669 columbia edu Yigang Zhang yz2345 columbia edu Yu Shao ys2528 columbia edu Rongzheng Yan ry2213 columbia edu William Chan wc2372 columbia edu COMS 4115 Programming Languages and Translators Professor Stephen A Edwards October 22 22 2010 Columbia Columbia University University 1 Introudction Nowadays Sudoku game is becoming more and more popular aroung the world Sudoku oringinated in Japan is a logic based number placement puzzle The oringinal Sudoku game is based on a grid which is comprised of nine columns and nine rows Each row or column on the grid has all of the digits from one to nine Most of the time the grid is partially given Sudoku players have to complete the puzzle based their mathmatic and logic reasoning skills The SGDL is a language designed to create a Sudoku Game The language is easy for programmer to manipulate the matrix and the element in it to set rules for the game and to examine the rationality of the initialization SGDL s syntax is modeled after C C and will be built on top of those languages A SGDL format file will be the input file and the compiler will produce a C source file as output file that can then be compiled by any C C compiler SDGL saved Sudoku fans from spending their time to learn comlicate programming development techniques what they only need is the SDGL language which is easily understandable then they don t have to study anything else to design a Sudoku game By using SDGL user could create great Sudouku games using the built in methods SDGL also maintain the potential of extending the language further to enable programmers to develop word games such as word search puzzles and crossword puzzles 2 Lexical conventions 2 1 Comments The token will introduce a comment The will end the comment 2 2 Key Words int grid while bool if else not string for and or Scan true type false Random Print data type data left right Random is reserved for making sudoku game designs more extensible 2 3 Identifier An identifier is a sequence of letters and digits the first character must be alphabetic The underscore counts as alphabetic Upper and lower case letters are considered different No more than the first eight characters are significant and only the first seven for external identifiers 2 4 Constant There are several kinds of constants as follows 2 4 1 Integer constants An integer constant is a sequence of digits The language only takes decimal 2 4 2 String constants String constants are sequence of characters surrounded by quote marks Characters are also part of the string constants 3 Types 3 1 Primitive Data Types 3 1 1 String The String type is comprise of a sequence of charactrers Also strings are constant Once you set up values for this type you cannot change them 3 1 2 Integer A basic type that contains a 32 bit signed integer with a range of 2147483648 to 2147483647 3 1 3 Boolean There are two possible values for the boolean type either true or false Also true is any nonzero integer value and false can be represented as zero 3 1 4 Array An array type is a matrix of a primitive type Array arrayname row col rol refers to the number of rows to be created in the array and col refers to the number of columns to be created in the array Example Array x 2 3 the array 1 2 3 2 3 4 x 1 2 3 2 3 4 This creates 3 2 Object Type 3 2 1 Grid The Grid type represents the basic element of sudoku game Properties Cell row column refers to the cell specified by the parameters Returns the value of that cell Example int a a object cell 6 6 Row row the value surrounded by the refers to the specific row Returns a one dimensional array containing all the values in that row Example array r 1 4 Column column r object row 6 the value surrounded by the refers to the specific column Returns a one dimensional array containing all the values in that column Example array c 4 1 Diagonal left right c object column 6 refers to the two diagonals in the grid Left refers the diagonal starting at the upper left hand corner while the right refers to the diagonal starting at the upper right hand corner Returns a one dimensional array that contains all the values in that diagonal Example array d 1 4 d object diagonal left Block row column sub square of the grid The block is referenced by the parameters indicating the location of the upper left corner cell in the block Returns an array with the same dimensions as the block and containing the values of each cell in the block Example array e 3 3 e object block 3 4 refers to a particular row of blocks The value in the Band band parentheses refers to the band number starting with band 0 at the top and band n at the bottom Returns an array with row size equal to the blocks row size and the column size is the sum of all the column sizes of the blocks The elements in the array will contain each cell s value that includes each cell value from upper left corner to the the bottom right corner of each block Example array f 3 9 Stack stack f object band 2 refers to a particular column of blocks The value in the parentheses refers to the stack number starting with stack 0 on the left and stack n on the right Returns an array with column size equal to the blocks column size and the row size is the sum of all the row sizes of the blocks The elements in the array will contain each cell s value from the upper left corner to the the bottom right corner of each block Example array g 9 3 g object stack 2 Method SetAsGiven false true whether to show the value s in the specified cell s By default all the cells in the grid are set to not visible IsRepeatable false true whether the values in the specified cells can be duplicates IsVisible row column whether the cell is visible With value of ture or false DefineBlock rowsize columnsize allows the programmer to define a sub square of the grid Its row and column dimensions must be factors of the grid s row and column dimensions respectively SumOfRows integer the total that all the values in each row must sum to SumOfColumns integer the total that all the values in each column must sum to SumOfDiagonals integer the total that all the values in each diagonal must sum to SumOfBlocks integer the total that all the values in each block must sum to MaxValueOfRows integer what the maximum value of each row is permitted to be MaxValueOfColumns integer what the maximum value of each column is permitted to be MaxValueOfDiagonals integer what the


View Full Document

Columbia COMS W4115 - Sudoku Game Design Language

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

Synapse

Synapse

11 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Loading Unlocking...
Login

Join to view Sudoku Game Design Language and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Sudoku Game Design Language and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?