From 75ad669f06207b8e2813c7ae4f238d46dab25160 Mon Sep 17 00:00:00 2001 From: arun Date: Tue, 14 Nov 2006 20:00:18 +0000 Subject: [PATCH 1/1] Initial import --- index.php | 210 +++++++++++++++++++++++++++++++++++++++++++++++++++++ random.txt | 4 + status.txt | 5 ++ 3 files changed, 219 insertions(+) create mode 100644 index.php create mode 100644 random.txt create mode 100644 status.txt diff --git a/index.php b/index.php new file mode 100644 index 0000000..90b91ce --- /dev/null +++ b/index.php @@ -0,0 +1,210 @@ + + + + Doko via email + + + +

Welcome to E-Doko

+ +"; + echo " player 1
"; + echo " player 2
"; + echo " player 3
"; + echo " player 4
"; + /* read in random.txt */ + if(file_exists("random.txt")) + $random = file("random.txt"); + else + die("no random file"); + + $randomNR = explode( ":", $random[1] ); + + /* write status into file */ + $output = fopen("status.txt","w"); + if ($output) + { + fwrite($output, "0\n"); + + fwrite($output, "hash1:".$PlayerA.":".$EmailA."::" ); + for($i=0;$i<12;$i++) + fwrite($output,";$randomNR[$i]" ); + fwrite($output,"\n"); + + fwrite($output, "hash2:$PlayerB:$EmailB::" ); + for(;$i<24;$i++) + fwrite($output,";$randomNR[$i]" ); + fwrite($output,"\n"); + + fwrite($output, "hash3:$PlayerC:$EmailC::" ); + for(;$i<36;$i++) + fwrite($output,";$randomNR[$i]" ); + fwrite($output,"\n"); + + fwrite($output, "hash4:$PlayerD:$EmailD::"); + for(;$i<48;$i++) + fwrite($output,";$randomNR[$i]" ); + fwrite($output,"\n"); + + fclose($output); + } + else + echo "can't open file for writing"; +}; + +/* test if a game is running, else output everything for a new game */ +if(sizeof($lines)<2) +{ +?> +

no game in progress, please input 4 names and email addresses

+
+ Name: + Email:
+ + Name: + Email:
+ + Name: + Email:
+ + Name: + Email:
+ + +
+ +
+ Do you want to play a game of DoKo? + yes + no
+ + Do you want to get an email for every card played or only if it your move? + every card + only on my turn
+\n"; + echo "\n"; + echo "\n"; + echo "
\n"; +} + /* yes? email him his hand, ask for solo, poverty, email every move or every card? */ +if(isset($_REQUEST["b"])) +{ + $b=$_REQUEST["b"]; + echo "hash is $b
"; + if(!isset($_REQUEST["in"])|| !isset($_REQUEST["update"]) ) + { + echo "go back to "; + echo " here and fill out the form
"; + } + else + { /* show the hand */ + echo $player[$b]["cards"]; + $tmp = $player[$b]["cards"]; + $cards = explode( ":",$tmp); + echo "your cards are"; + foreach($cards as $card) echo " $card "; + echo "
\n"; + ?> +
+ + do you want to play solo? + yes + no
+ + do you have a wedding? + yes + no
+ + do you have poverty? + yes + no
+ + + + + + +
+ + + + + diff --git a/random.txt b/random.txt new file mode 100644 index 0000000..4c57a78 --- /dev/null +++ b/random.txt @@ -0,0 +1,4 @@ +16:28:37:44:7:39:9:2:21:41:27:42:43:46:8:17:4:25:31:45:23:35:30:18:24:6:29:34:26:48:14:32:19:3:1:47:40:33:5:22:20:38:13:15:12:36:10:11: +30:15:45:41:32:5:9:14:42:20:27:40:1:19:21:18:26:6:43:29:31:33:37:13:4:46:24:22:35:7:16:38:2:28:23:48:47:10:3:8:39:11:36:44:17:12:34:25: +22:8:16:36:21:24:41:27:12:14:25:2:26:48:10:47:18:35:33:3:39:4:9:15:30:13:31:38:19:45:6:29:42:23:37:5:1:32:46:40:28:44:7:43:17:34:20:11: +19:14:48:15:6:7:25:43:18:17:24:9:44:45:2:27:8:31:30:1:16:41:20:37:29:32:40:11:47:46:13:42:4:33:3:23:10:39:21:28:36:38:5:35:22:12:34:26: diff --git a/status.txt b/status.txt new file mode 100644 index 0000000..20f66ab --- /dev/null +++ b/status.txt @@ -0,0 +1,5 @@ +0 +hash1:a:bbv::;30;15;45;41;32;5;9;14;42;20;27;40 +hash2:b:asdf::;1;19;21;18;26;6;43;29;31;33;37;13 +hash3:da:sd::;4;46;24;22;35;7;16;38;2;28;23;48 +hash4:kljdkljs:asdf@sdf::;47;10;3;8;39;11;36;44;17;12;34;25 -- 2.25.1