Presentation is loading. Please wait.

Presentation is loading. Please wait.

The internet Zurich Water Game

Similar presentations


Presentation on theme: "The internet Zurich Water Game"— Presentation transcript:

1 The internet Zurich Water Game
ZWG3

2 Distributed multi-user models
Participants can be anywhere, provided that they have internet access E.g. in their office No duration restrictions Can be involved while doing their ordinary work Can implement private negotiations easily But Less motivation without face-to-face interaction Technical difficulties less easy to solve Requires internet access

3 Implementation options
Client-side Needs to run on many differently configured PCs Java, Javascript OR Server side All software runs on a central server Server generates HTML pages dynamically Client only needs a web browser

4 Server side implementation
Apache web server Standard web server PHP Scripting language All normal programming constructs Basic object orientated features Good interfaces to other software and libraries Relational database PostgreSQL MySQL TCP/IP or other inter-process communication to other models All this is open source, free and available under the GNU licence

5 Examples Gone Fishing! Zurich Water Game 3 Test the technology
Competitive game Simple rules Extensible (robot fishers!) Zurich Water Game 3

6 The server Program Apache Web PHP Server module HTML Data read/write
Page request HTML Data read/write Web page PostgreSQL database

7 Sample PHP <?php function show_scale($val) {
/* display a bar to show value of $val */ $val=round($val); if ($val > 10) $val = 10; if ($val < 0 ) $val = 0; $colour = ($val >= 5 ? 'grn' : 'red'); echo "<td><img SRC=\"images/bar-$colour-$val.jpg\" ALT=\"Value=$val\" width=104 height=14></td>\n"; } ?>

8 Interface between PHP and database
$n_msgs = 3; /* get the last 3 public messages */ $query = new query("SELECT id, sender, recipient, to_char(timesent, 'HH24:MI on DD Mon') as senttime, timeread, msg FROM msgs WHERE (recipient = 'All') ORDER BY timesent DESC LIMIT $n_msgs"); display_msgs($query); ?>


Download ppt "The internet Zurich Water Game"

Similar presentations


Ads by Google