Permalink
Browse files

Initial

  • Loading branch information...
0 parents commit b6168976dd552ee55e6529e8198b15ed3150e66c Geoff Greer committed Sep 24, 2011
Showing with 131 additions and 0 deletions.
  1. +33 −0 birthday_payoff.html
  2. +35 −0 index.html
  3. +38 −0 payoff.html
  4. +25 −0 payoff_matrix.py
@@ -0,0 +1,33 @@
+<html>
+<head>
+<style media="screen" type="text/css">
+td
+{
+ padding: 2px;
+ background-color: #ddd;
+}
+</style>
+</head>
+<body>
+<h1>Why you should never tell your birthday to your friends</h1>
+
+http://localhost:8080/?title=Why you should never tell your birthday to your friends&left=Tell&right=Don't tell&up=Friends celebrate your birthday&down=Friends don't celebrate your birthday&payoff_up_left=Maybe they're only doing it out of politeness&payoff_up_right=They genuinely care about you enough to find out your birthday and celebrate it&payoff_down_left=Your friends don't care about you enough to celebrate your birthday&payoff_down_right=No loss. They don't know when your birthday is.
+
+<table>
+ <tr>
+ <td><h3>Payoff matrix</h3></td>
+ <td>Tell</td>
+ <td>Don't Tell</td>
+ </tr>
+ <tr>
+ <td>Friends celebrate your birthday</td>
+ <td style="background-color:#fcc;">Maybe they're only doing it out of politeness</td>
+ <td style="background-color:#9d9;">They genuinely care about you enough to find out your birthday and celebrate it</td>
+ </tr>
+ <tr>
+ <td>Friends don't celebrate your birthday</td>
+ <td style="background-color:#e66;">Your friends don't care about you enough to celebrate your birthday</td>
+ <td>No loss. They don't know when your birthday is.</td>
+ </tr>
+</body>
+</html>
@@ -0,0 +1,35 @@
+<html>
+<head>
+<style media="screen" type="text/css">
+td
+{
+ padding: 2px;
+ background-color: #ddd;
+}
+</style>
+</head>
+<body>
+<form action="payoff" method="GET">
+<h1>Title <input type="text" name="title" /></h1>
+<table>
+ <tr>
+ <td></td>
+ <td>Left <input type="text" name="left" /></td>
+ <td>Right <input type="text" name="right" /></td>
+ </tr>
+ <tr>
+ <td>Up <input type="text" name="up" /></td>
+ <td>Payoff up-left <input type="text" name="payoff_up_left" /></td>
+ <td>Payoff up-right <input type="text" name="payoff_up_right" /></td>
+ </tr>
+ <tr>
+ <td>Down <input type="text" name="down" /></td>
+ <td>Payoff down-left <input type="text" name="payoff_down_left" /></td>
+ <td>Payoff down-right <input type="text" name="payoff_down_right" /></td>
+ </tr>
+</table>
+<input type="submit" value="Generate!" />
+</form>
+</body>
+</html>
+
@@ -0,0 +1,38 @@
+$def with (data)
+
+<html>
+<head>
+<style media="screen" type="text/css">
+td
+{
+ padding: 2px;
+ background-color: #ddd;
+}
+</style>
+</head>
+<body>
+<h1>$data.title</h1>
+<table>
+ <tr>
+ <td></td>
+ <td>$data.left</td>
+ <td>$data.right</td>
+ </tr>
+ <tr>
+ <td>$data.up</td>
+ <td>$data.payoff_up_left</td>
+ <td>$data.payoff_up_right</td>
+ </tr>
+ <tr>
+ <td>$data.down</td>
+ <td>$data.payoff_down_left</td>
+ <td>$data.payoff_down_right</td>
+ </tr>
+</table>
+<p>
+<a href="">Copy this link to share this matrix.</a>
+<a href="./">Generate another payoff matrix.</a>
+</p>
+</body>
+</html>
+
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+
+import web
+render = web.template.render('.')
+
+urls = (
+ '/', 'index',
+ '/payoff', 'payoff'
+)
+
+app = web.application(urls, globals())
+
+class index:
+ def GET(self):
+ return render.index()
+
+class payoff:
+ def GET(self):
+ data = web.input()
+
+ return render.payoff(data)
+
+if __name__ == "__main__": app.run()
+
+

0 comments on commit b616897

Please sign in to comment.