a variant of wff ‘n proof - imperial college londonak6309/equations - a variant of wff 'n...
TRANSCRIPT
A variant of Wff ‘n Proof
Agnieszka Pinchinat-Miernik | Alexander Karapetian | Steven Pool
Chengcheng Cui | Jiahui Tan
The Team Project Manager - Alexander Karapetian
Front-End Architect – Agnieszka Pinchinat
Front-End Integration Engineer – Steven Pool
Back-End Database Admin – Chengcheng Cui
Back-End Server-Side Engineer – Jiahui Tan
Wff ‘n Proof pronunciation: /ˈwu̇f ən ˈprüf/
Created by Prof Lehman Allen
MIT, 1961
Dice labelled with ND symbols
Wff ‘n Proof pronunciation: /ˈwu̇f ən ˈprüf/
Created by Prof Lehman Allen
MIT, 1961
Dice labelled with ND symbols
3 mats
Permitted
Required
Forbidden
Target arithmetic proof derived
Take turns to move dice to mats
Aim to build goal expression
The Equations Variant
Target arithmetic proof derived
Take turns to move dice to mats
Aim to build goal expression
Simpler gameplay
The Equations Variant
Target arithmetic proof derived
Take turns to move dice to mats
Aim to build goal expression
Simpler gameplay
Similar to Countdown’s Numbers round
The Equations Variant
The Equations Variant
Relabelled dice
Digits
Operators
Simplified for children
Build target expressions
Intellectual benefits
The Community
Academic Games Leagues of America (AGLOA)
Frequent tournaments held
Variants aimed at children
Equations
The Equations Project
Research
Existing games online?
Revival
Pioneer one of the first online modernisations
Bring to wider audience (casual gamers, parents, …)
The Equations Project
Research
Existing games online?
Revival
Pioneer one of the first online modernisations
Bring to wider audience (casual gamers, parents, …)
Specification
Online multiplayer game
Available Tools Windows
Visual Studio
.NET Framework
2.0, 3.0, 3.5, 4.0
WPF / Silverlight
C#, VB.NET
LINQ
ASP.NET & IIS
Microsoft SQL Server
Linux
Eclipse IDE
Java
Web Applet
Swing
Apache Server
PostgreSQL
Available Tools - Decisions Windows
Visual Studio
.NET Framework
2.0, 3.0, 3.5, 4.0
WPF / Silverlight
C#, VB.NET
LINQ
ASP.NET & IIS
Microsoft SQL Server
Linux
Eclipse IDE
Java
Web Applet
Swing
Apache Server
PostgreSQL
Browser targeting
Firefox
Windows
Mac Linux
Trace Monkey Engine
Internet Explorer
Windows only
ActiveX Hardware Acc. (IE9)
Windows
Google Chrome
Mac Linux
(Chromium)
V8 engine
Game Features Registration
Persistent profiles maintained
Ensuring username uniqueness
Password SHA-1 hashed for database
Security question reset options available
Game Features Registration
Persistent profiles maintained
Ensuring username uniqueness
Password SHA-1 hashed for database
Security question reset options available
Gameplay
Supports 2-8 players per game
Supports many games
Mechanisms included to prevent malicious play
Wave progression:
Discrete time units :: vary based on difficulty
Random dice allocation on progression
Disrupts strategy, incentivises faster play
Wave countdown timer UI element
Strategy / gameplay improvements
Employing WAVE
Mechanics WAVE
Continuous gameplay
Non-repetition
Environment progression
Time consciousness
Non-Malicious
Multiplayer
Structure
Game lobby
Game tables
Difficulty modes / Varying mats
Beginner (Permitted)
Intermediate (Permitted, Required)
Advanced (Permitted, Required, Forbidden)
Strategy
Challenges
Now – goal has been made
Never – goal cannot be formed
Scoring
Players side with challenger
Enhancements We care about the experience…
Equations – the UX
Drag and drop dice for ease of use
Canvas provided for testing expressions
Enhancements We care about the experience…
Equations – the UX
Drag and drop dice for ease of use
Canvas provided for testing expressions
Game feed displaying chat / important events
Enhancements We care about the experience…
Equations – the UX
Drag and drop dice for ease of use
Canvas provided for testing expressions
Game feed displaying chat / important events
Syntax
Background expression evaluation engine (ANTLR)
Pair Programming
Labs (co-located)
Efficient knowledge transfer
Increased bug capture
Continuous improvement
Region Detection
Difficulty for drag & drop
Solution: split mat area into 5 regions
|----------------------|
| | |
| 1 | 2 |
| | |
|-----------.----------|
| 3 / \ 4 |
| / \ |
| / 5 \ |
|----------------------|
Region Detection int mid_x = x+(WIDTH/2);
int mid_y = y+(HEIGHT/2)-40;
double angle = ((double)150/(HEIGHT-(mid_y-y)));
if(_y <= mid_y && _y >= y){
if(_x<=mid_x && _x >= x){
//Area 1: Permitted
}
else if(_x > mid_x && _x < x+WIDTH){
//Area 2: Required
}
}
else if(_y > mid_y && _y <= y+HEIGHT){
int max = (int) ( angle * (y+HEIGHT-_y) );
if ( _x >= x && _x <= x+WIDTH ) {
if ( _x <= max + x ) {
//Area 3: Permitted
}
else if ( _x > WIDTH-max + x ) {
//Area 4: Required
}
else {
//Area 5: Forbidden
}
}
}
The State Interface paint()
Draws entire state
updateState()
Refreshes content
leaveState()
Unbind components
enterState()
Add controls to canvas
Equations Grammar
A Number is an integer or decimal value:
Number : ('0'..'9')+
An Atomic Expression is a Number and can include brackets:
atomExp returns [int at] :
Number {$at = Integer.parseInt($Number.text); }
| '(' v1 = additionExp { $at = $v1.a; } ')';
Equations Grammar
A Number is an integer or decimal value:
Number : ('0'..'9')+
Whitespace is ignored:
WS : (' ' | '\t' | '\r'| '\n') {$channel=HIDDEN;}
An Atomic Expression is a Number and can include brackets:
atomExp returns [int at] :
Number {$at = Integer.parseInt($Number.text); }
| '(' v1 = additionExp { $at = $v1.a; } ')';
Equations Grammar (cont.)
Addition and Subtraction have the lowest precedence:
additionExp returns [int a] :
v1 = multiplyExp { $a = $v1.d; }
( '+' v2 = multiplyExp { $a = $a + $v2.d; }
| '-' v2 = multiplyExp { $a = $a - $v2.d; } )* ;
Equations Grammar (cont.)
Addition and Subtraction have the lowest precedence:
additionExp returns [int a] :
v1 = multiplyExp { $a = $v1.d; }
( '+' v2 = multiplyExp { $a = $a + $v2.d; }
| '-' v2 = multiplyExp { $a = $a - $v2.d; } )* ;
Multiplication and Division have higher precedence:
multiplyExp returns [int d] :
v1 = powerExp { $d = $v1.p; }
( ('×' | 'x' | '.' | '*' | 'X') v2 = powerExp { $d = $d * $v2.p; }
| '/' v2 = powerExp { $d = (int)Math.round((double)$d/$v2.p); } )*;
Equations Grammar (cont.)
Powering is also supported:
powerExp returns [int p] :
v1 = atomExp { $p = $v1.at; } ( '^‘
v2 = atomExp { $p = (int)Math.pow($p, $v2.at); } )*
| ( '√' v1 = atomExp { $p = (int)Math.round(Math.sqrt($v1.at)); } );
Future Direction Java
Mobile Development / Browser UAS
HTML5
True cross platform compatibility
Single player AI
Future Direction Java
Mobile Development / Browser UAS
HTML5
True cross platform compatibility
Single player AI
? – A Variant of Equations
Crossword style point scoring
Encourages use of complex expressions
Adds significance to player scores
References Tools
ANTLR Parser Generator – http://www.antlr.org/
Equations Tournament Rules - http://bit.ly/AlFbcF
Wff ‘n Proof References
http://www.wffnproof.com/
http://mlagonline.com/Wff.html
Questions? Alexander Karapetian
Chengcheng Cui
Jiahui Tan
Steven Pool
Agnieszka Pinchinat-Miernik