Php Editor-in-the-air programming ideas, Web edition
After reading the shell version released by open-source Chinese netizens, I tried to test it. I hope you will not be embarrassed to know the shortcomings.
-
-
-
- Search for information
-
-
-
-
-
-
-
-
-
- If (isset ($ _ POST ['sub']) {
- $ What = $ _ POST ['wh'];
-
- // Array to be input
- $ My_array = array ("scissors", "Stone", "cloth ");
-
- // Winning rule
- $ Guize = array ("scissors", "cloth"), array ("cloth", "Stone"), array ("stone", "scissors "));
-
- // Obtain the random value in the array
- $ Rand_keys = array_rand ($ my_array );
- $ Computer = $ my_array [$ rand_keys];
-
- Echo $ computer. "\ n ";
-
-
- $ Input = array ($ computer, $ what );
- // Construct the random value of the input and the computer into an array, and then judge that the value is not in the winning rule.
-
- If (! (In_array ($ what, $ my_array ))){
- Echo "please input scissors, stones, cloth ";
- Header ("location: index. php ");
- }
-
- If ($ computer = $ what ){
- Echo "Oh, flat ";
- } Elseif (in_array ($ input, $ guize )){
- Echo "computer wins ";
- } Else {
- Echo "you win ~ ";
-
- }
-
- }
- ?>
|