Unformatted text preview:

Pa aml Pac Man Game Programming Language Final Report 12 22 2011 Chun Kang Chen cc3260 Hui Hsiang Kuo hk2604 Shuwei Cao sc3331 Wenxin Zhu wz2203 Thanks to our teammates Contents 1 An Introduction to PaCaml 1 1 1 Background 1 1 2 Description 1 1 3 Features 2 1 4 A Quick Look at PaCaml Code 2 2 Language Tutorial 4 2 1 Sample Program 4 2 2 How to Compile and Run the Sample Program 5 2 3 How to Write a PaCaml Source File 6 2 4 Other Functionalities 10 2 4 1 Functions 10 2 4 2 Arithmetic Functionality 10 2 4 3 Assignment 11 2 4 4 Recursive 11 2 4 5 Loop 12 2 4 6 Logic 12 2 4 7 Condition 13 3 Language Reference Manual 15 3 1 Lexical conventions 15 3 1 1 Comments 15 3 1 2 Naming 15 3 1 3 Keywords 16 3 2 Data Types 16 3 2 1 Primitive Data Types 16 3 2 2 Derived Data Types 17 3 2 3 Game specific Types 17 3 3 Expressions 19 3 3 1 Unary operators 19 3 3 2 Additive operators 19 I 3 3 3 Multiplicative operators 20 3 3 4 Relational operators 20 3 3 5 Equality operators 21 3 3 6 expression expression 21 3 3 7 expression expression 21 3 4 Declarations 21 3 5 Statements and Blocks 21 3 5 1 Expression statement 21 3 5 2 Conditional statement 22 3 5 3 While statement 22 3 5 4 Blocks 22 3 5 5 Return statement 23 3 6 Function Definitions 23 3 6 1 Basic Functions 23 3 6 2 Built in Functions 23 4 Project Plan 26 4 1 Project Management Process 26 4 2 Programming Style Guide 26 4 3 Project Time Management 27 4 3 1 Events List 27 4 3 1 Events and Time Estimation 28 4 3 2 Gantt Chart 28 4 4 Roles and Responsibilities 29 4 5 Software Development Environment 29 4 5 1 Operating System 29 4 5 2 Version Control System 29 4 5 3 Language Used 29 4 5 4 File Sharing 30 4 6 Project Log 30 5 Architectural Design 31 5 1 Block Diagram 31 II 5 2 Interfaces 31 5 3 Task Distribution 32 6 Test Plan 33 6 1 Representative Source Code 33 6 2 Test Suites 33 6 2 1 Arithmetic 33 6 2 2 Logic 34 6 2 3 if 35 6 2 4 for 35 6 2 5 while 35 6 2 6 Functions 36 6 2 7 Derived Types 36 6 2 8 Pac Man related functions 37 6 3 Testing Method Testing Automation 37 7 Lessons Learned 38 7 1 Lessons Learned 38 7 1 1 Chun Kang Chen 38 7 1 2 Hui Hsiang Kuo 38 7 1 3 Wenxin Zhu 39 7 1 4 Shuwei Cao 39 7 2 Advice for Future Teams 40 Reference 41 Appendix 42 Appendix A 1 ast ml 42 Appendix A 2 scanner mll 43 Appendix A 3 parser mly 44 Appendix A 4 interpret ml 45 Appendix A 5 game ml 55 Appendix A 6 classes ml 60 Appendix A 7 pacaml ml 62 Appendix B Makefile 63 III Appendix C 1 hello world pacaml 64 Appendix C 2 hello test arith pacamll 64 Appendix C 3 test assignment pacaml 64 Appendix C 4 test fib pacaml 65 Appendix C 5 test for pacaml 65 Appendix C 6 test func pacaml 65 Appendix C 7 test gcd pacaml 66 Appendix C 8 hello test if pacaml 66 Appendix C 9 test logic pacaml 66 Appendix C 10 test objects pacaml 67 Appendix C 11 test pacman pacaml 67 Appendix C 12 test while pacaml 69 Appendix D SVN Log 70 IV Chapter 1 An Introduction to PaCaml PaCaml is a game programming language which facilitates the design of elements in PAC MAN scene such as maps characters items and winning conditions It is designed especially for those who have wished to be a God in the world of Pac Man PaCaml helps recall a generations of 1980 s of the best of their childhood memories 1 1Background PAC MAN is an arcade game immensely popular since its original release and is considered as an icon of 1980 s popular culture 1 It has made a great impact on a generation of people and is still appealing to the public for today 2 However the game scenes of each stage the size of the map winning condition and the number of ghosts etc in PAC MAN is all pre designed and players are unable to create or change them It could be a great fun if the players can design a PAC MAN based on their own favorite Therefore we introduce PaCaml a PAC MAN game design language which enables users to create their favorite scenes and design whatever they like to make PAC MAN more interesting 1 2Description The language PaCaml PAC MAN Ocaml is developed using Ocaml language It is text based and java like but has its own primitives The language has a main function like C and each statement ends with a semicolon The basic idea and rules in PAC MAN will not be changed However the language allows users to design mazes number and distribution of eating dots number and speed of the ghosts location of the power pellets figure of each character etc Users can also design the condition of scoring and set the winning condition using the language 1 1 3Features Simple We aim to design a language which can be fast and easily learned by users As most of programmers today have dealt with Java we design PaCaml and make it very similar to Java in syntax and expressions We omit some data types which are not necessary in PaCaml such as any floating point related types boolean etc We also add some game related functions like setMap setPlayer which make the language easy to program Object oriented PaCaml inherits the technique of object oriented design from Java which focuses on the data objects and on the interfaces to it Statically scoped PaCaml is statically scoped which means that the environment in PaCaml which is extended and becomes current when a procedure is called is the environment in which the procedure was created Applicative ordered PaCaml uses applicative order during the evaluation Robust As we have said the programmer will be the God in the world of Pac Man which means they can design the Pac Man as they wish Users are able to design the strategy of the ghosts color of characters etc Interesting Our goal is to make Pac Man programming as interesting as possible Unlike other languages which might be tedious during programming PaCaml is designed to be friendly interacted with programmers 1 4A Quick Look at PaCaml Code int main create a barrier a ghost and add them to the map point p player pacman 2 item bar item ghost add a barrier p getAvailablePoint bar i type BARRIER bar i point p addBarrier bar randomly choose a point set type set …


View Full Document

Columbia COMS W4115 - An Introduction to PaCaml

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 An Introduction to PaCaml 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 An Introduction to PaCaml 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?