Commander Posted September 20, 2015 Author Share Posted September 20, 2015 | | | | | | | | | | | | | My turn, I removed row 1---------- edit, in my analysis, I am player A because I am the first to have removed a row. You are player B And I do : | | | | | | | | | | | | Link to comment Share on other sites More sharing options...
michel123456 Posted September 20, 2015 Share Posted September 20, 2015 | | | | | | ------------------ A A Link to comment Share on other sites More sharing options...
Commander Posted September 20, 2015 Author Share Posted September 20, 2015 | | | | | | ------------------ A A Now : | | | | 1 Link to comment Share on other sites More sharing options...
michel123456 Posted September 20, 2015 Share Posted September 20, 2015 You win wathever I do nowAnyway I play this | | | 1 Link to comment Share on other sites More sharing options...
Commander Posted September 21, 2015 Author Share Posted September 21, 2015 (edited) You win wathever I do now Anyway I play this | | | Yes, I remove 2 and leave 1 Nice that you are approaching logically. Good try Edited September 21, 2015 by Commander 1 Link to comment Share on other sites More sharing options...
tar Posted September 24, 2015 Share Posted September 24, 2015 Commander, OK. You move first. Regards, TAR Link to comment Share on other sites More sharing options...
Commander Posted September 24, 2015 Author Share Posted September 24, 2015 (edited) Commander, OK. You move first. Regards, TAR TAR , Alright, here we go. I think you have now analyzed well and I might have a tough time. Regards, Thomas | | | | | | | | | | | | | | | Edited September 24, 2015 by Commander Link to comment Share on other sites More sharing options...
tar Posted September 24, 2015 Share Posted September 24, 2015 Commander, Yes, I should be a little more nimble, and a bit more of a challenge. | | | | | | | | | | | | Regards, TAR Link to comment Share on other sites More sharing options...
Commander Posted September 24, 2015 Author Share Posted September 24, 2015 Commander, Yes, I should be a little more nimble, and a bit more of a challenge. | | | | | | | | | | | | Regards, TAR Hi, there was an error on the initial board You need to move now.from : | | | | | | | | | | | | | | | Link to comment Share on other sites More sharing options...
tar Posted September 24, 2015 Share Posted September 24, 2015 Commander, Sorry, I didn't notice the error. | | | | | | | | | | | | | | Regards, TAR Link to comment Share on other sites More sharing options...
Commander Posted September 24, 2015 Author Share Posted September 24, 2015 Commander, Sorry, I didn't notice the error. | | | | | | | | | | | | | | Regards, TAR TAR : Let me try : | | | | | | | | | | | Regards , Thomas Link to comment Share on other sites More sharing options...
tar Posted September 24, 2015 Share Posted September 24, 2015 Commander, I will try this. | | | | | | | | | | Regards, TAR Link to comment Share on other sites More sharing options...
Commander Posted September 24, 2015 Author Share Posted September 24, 2015 Commander, I will try this. | | | | | | | | | | Regards, TAR TAR : Now this : | | | | | | | | | Regards, Thomas Link to comment Share on other sites More sharing options...
tar Posted September 24, 2015 Share Posted September 24, 2015 Commander, | | | | | | Regards, TAR 1 Link to comment Share on other sites More sharing options...
Commander Posted September 24, 2015 Author Share Posted September 24, 2015 Commander, | | | | | | Regards, TAR TAR : You got me there. Well done. Well played ! Regards, Thomas 1 Link to comment Share on other sites More sharing options...
fiveworlds Posted November 25, 2015 Share Posted November 25, 2015 The expert Programmers here like Sensei, fiveworlds , Janus etc can improve on the online implementation of this. Well since you asked so nicely. I made the game with zero security and it will allow a player to make as many moves as they want so be honest. <?php if(file_exists("matchsticks.txt")){ $matches=file_get_contents("matchsticks.txt"); if($matches==="\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\""){ $fp=fopen("matchsticks.txt","w"); fwrite($fp,"\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\""); fclose($fp); $matches="\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\""; } if(isset($_REQUEST["checkbox"])) { $matches = explode(",",str_replace("\"","",$matches)); for ($i = 0; $i < count($_REQUEST["checkbox"]); ++$i) { $matches[$_REQUEST["checkbox"][$i]]=0; } $temp=NULL; for ($i = 0; $i < count($matches); ++$i){ $temp=$temp."\"".$matches[$i]."\"".","; } $matches=trim($temp, ","); file_put_contents("matchsticks.txt",$matches); } echo "<script>matches=new Array({$matches});"; loadpage(); } else{ echo "<script>matches=new Array(\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\";)"; loadpage(); $fp=fopen("matchsticks.txt","w"); fwrite($fp,"\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\""); fclose($fp); } function loadpage(){ echo "var images = new Array(); var checkboxes = new Array(); var table = \"\"; var form = \"\"; for (index = 0; index < matches.length; index++) { if(matches[index]===\"1\") { images[index]=\"<img src=matchstick.jpg />\"; checkboxes[index]=\"<input type='checkbox' name='checkbox[]' value='\"+index+\"'>\"; } else { images[index]=\" \"; checkboxes[index]=\"\"; } if(index===0) { table+=\"<table><tr><td>\"+images[index]+\"</td><td> </td><td> </td><td> </td><td> </td></tr>\"; form+=\"<form method=get>Row 1\"+checkboxes[index]+\"<input type='submit' value='Submit'></br></form>\"; } if(index===2) { table+=\"<tr><td>\"+images[index-1]+\"</td><td>\"+images[index]+\"</td><td> </td><td> </td><td> </td></tr>\"; form+=\"<form method=get>Row 2\"+checkboxes[index-1]+checkboxes[index]+\"<input type='submit' value='Submit'></br></form>\"; } if(index===5) { table+=\"<tr><td>\"+images[index-2]+\"</td><td>\"+images[index-1]+\"</td><td>\"+images[index]+\"</td><td> </td><td> </td></tr>\"; form+=\"<form method=get>Row 3\"+checkboxes[index-2]+checkboxes[index-1]+checkboxes[index]+\"<input type='submit' value='Submit'></br></form>\"; } if(index===9) { table+=\"<tr><td>\"+images[index-3]+\"</td><td>\"+images[index-2]+\"</td><td>\"+images[index-1]+\"</td><td>\"+images[index]+\"</td><td> </td></tr>\"; form+=\"<form method=get>Row 4\"+checkboxes[index-3]+checkboxes[index-2]+checkboxes[index-1]+checkboxes[index]+\"<input type='submit' value='Submit'></br></form>\"; } if(index===14) { table+=\"<tr><td>\"+images[index-4]+\"</td><td>\"+images[index-3]+\"</td><td>\"+images[index-2]+\"</td><td>\"+images[index-1]+\"</td><td>\"+images[index]+\"</td></tr></table>\"; form+=\"<form method=get>Row 5\"+checkboxes[index-4]+checkboxes[index-3]+checkboxes[index-2]+checkboxes[index-1]+checkboxes[index]+\"<input type='submit' value='Submit'></br></form>\"; } } document.write(table+form); </script>"; } ?> 1 Link to comment Share on other sites More sharing options...
Commander Posted December 18, 2015 Author Share Posted December 18, 2015 Thank you Fiveworlds ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now