+ All Categories
Home > Documents > E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

Date post: 17-Jan-2016
Category:
Upload: dwight-price
View: 214 times
Download: 0 times
Share this document with a friend
Popular Tags:
12
E E xpressing xpressing Z Z ombies ombies as as P P rogrammable rogrammable I I ndividuals ndividuals Abhinav Sharma Wayne Shu Miles Ulrich
Transcript
Page 1: E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

EExpressingxpressing

ZZombiesombies

asasPProgrammablerogrammable

IIndividualsndividuals Abhinav Sharma

Wayne ShuMiles Ulrich

Page 2: E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

What is EZ as PI?What is EZ as PI?An imperative, interpreted

language for zombie apocalypse simulation

Educational and fun language for novice programmers

Emphasis on simplicity and flexibility

Page 3: E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

MotivationMotivationZombies are cool!!

Simulate the spread of an epidemic

Let’s see how Humans can save themselves….Will they??

Page 4: E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

Sample OutputSample OutputSource Code:

Page 5: E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

Elements of LanguageElements of LanguageBasic Types

#number

@location

^direction

?boolean

!string

Dynamic Attributes (Methods)

##dynamicnum

^^dynamicdirection

Human/Zombie

#speed

#power

@start

^strategy

!name

Page 6: E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

Basic Program StructureBasic Program StructureDefinitions

- Set constants- Define dynamic attributes

Creation of Elements-Create a world-Populate world with humans & zombies

Simulation Phase- dynamic variations- per clock cycle

Post processing

Page 7: E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

Sample ProgramSample Program^^cautious

if imHumanreturn awayFrom nearestZombie

return toward nearestHumanend

##slowOverTimeif time < 100

return 100-timereturn 1

end

create world 20:10

create 20 zombies withspeed slowOverTimestrategy random

end

create 4 humans withstrategy cautious

end

run 100display graphical

end

print “There are {humanCount} humans still alive”

Page 8: E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

Translator ArchitectureTranslator ArchitectureLexer Parser

Syntax

tree

Walker

Interpreter

EZ as PI

Library

Other supporting functions

Output

JVM

.ez Source

File

Page 9: E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

Tools and EnvironmentTools and EnvironmentDevelopment Tools:

Eclipse 3.5Java 1.6 SDK , SwingANTLR 3.2

Management Tools:Google Code – Version controlMS office

Operating System:WindowsLinux

Page 10: E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

TestingTesting

Black Box

White Box

Unit testing

System testing

Page 11: E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

Lessons LearntLessons LearntHow to manage time and

resources (limited, less members)Incremental approach towards

problem as a wholeModular is betterChoose the right tools!

Page 12: E xpressing Z ombies as P rogrammable I ndividuals Abhinav Sharma Wayne Shu Miles Ulrich.

Thank YouThank You


Recommended