Guest User

Wargames (Thermonuclear War) from the movie

a guest
Jan 23rd, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.50 KB | None | 0 0
  1. 1.
  2. #!/bin/sh -
  3. 2.
  4. # $OpenBSD: wargames.sh,v 1.4 2003/06/03 03:01:42 millert Exp $
  5. 3.
  6. # $NetBSD: wargames.sh,v 1.2 1995/04/22 07:53:44 cgd Exp $
  7. 4.
  8. # $gNewSense: wargames.sh v 1.4 2013/03/13 01:24:48 paolo del bene Exp $
  9. 5.
  10. # $Android: wargames.sh v 1.4 2014/01/14 06:07:06 paolo del bene Exp $
  11. 6.
  12. # Copyright (c) 1985, 1993
  13. 7.
  14. # The Regents of the University of California. All rights reserved.
  15. 8.
  16. #
  17. 9.
  18. # Redistribution and use in source and binary forms, with or without
  19. 10.
  20. # modification, are permitted provided that the following conditions
  21. 11.
  22. # are met:
  23. 12.
  24. # 1. Redistributions of source code must retain the above copyright
  25. 13.
  26. # notice, this list of conditions and the following disclaimer.
  27. 14.
  28. # 2. Redistributions in binary form must reproduce the above copyright
  29. 15.
  30. # notice, this list of conditions and the following disclaimer in the
  31. 16.
  32. # documentation and/or other materials provided with the distribution.
  33. 17.
  34. # 3. Neither the name of the University nor the names of its contributors
  35. 18.
  36. # may be used to endorse or promote products derived from this software
  37. 19.
  38. # without specific prior written permission.
  39. 20.
  40. #
  41. 21.
  42. # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  43. 22.
  44. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  45. 23.
  46. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  47. 24.
  48. # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  49. 25.
  50. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  51. 26.
  52. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  53. 27.
  54. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  55. 28.
  56. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  57. 29.
  58. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  59. 30.
  60. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  61. 31.
  62. # SUCH DAMAGE.
  63. 32.
  64. #
  65. 33.
  66. # @(#)wargames.sh 8.1 (Berkeley) 5/31/93
  67. 34.
  68. #
  69. 35.
  70. echo -n "Would you like to play a game? "
  71. 36.
  72. read x a
  73. 37.
  74. x=`/usr/bin/basename $x`
  75. 38.
  76.  
  77. 39.
  78. if [ -f /usr/games/$x ] ; then
  79. 40.
  80. tput cl
  81. 41.
  82. exec /usr/games/$x $a
  83. 42.
  84. else
  85. 43.
  86. echo "A strange game."
  87. 44.
  88. echo "The only winning move is not to play."
  89. 45.
  90. fi
  91. 46.
  92. exit 0
  93. 47.
  94.  
  95. 48.
  96. it is necessary to create a folder with name wargames and copy the binary file in the folder wargames, i linked it on the screen and it works without problems, but the correct syntax is to put the binary file wargames in /usr/games
  97. 49.
  98. then you need to download the file basename in /usr/bin .
  99. 50.
  100. 51. it works :
  101. 52.
  102. 53.$ wargames
  103. 54. Would you like to play a game? y
  104. 55. A strange game.
  105. 56. The only winning move is
  106. 57. not to play.
  107. 58.
  108. 59. On android is a little different, to use it, you need of Framaroot or similar one to gain
  109. 60. privilegies on the mobile phone.
  110. 61. then you need to install busybox for your cpu which can be an Armv7; Armv9.......
  111. 62. you need a terminal; ....
  112. 63. the game to start on Android must be changed in:
  113. 64. #!/bin/sh -
  114. 65. # $OpenBSD: wargames.sh,v 1.4 2003/06/03 03:01:42 millert Exp $
  115. 66. # $NetBSD: wargames.sh,v 1.2 1995/04/22 07:53:44 cgd Exp $
  116. 67. # $gnewSense: wargames.sh, v 1.4 2013/03/13 01:24:48 paolo del bene Exp $
  117. 68. # $Android: wargames.sh, v 1.4 2014/01/14 06:07:06 paolo del bene Exp $
  118. 69. #
  119. 70. # Copyright (c) 1985, 1993
  120. 71. # The Regents of the University of California. All rights reserved.
  121. 72. #
  122. 73. # Redistribution and use in source and binary forms, with or without
  123. 74. # modification, are permitted provided that the following conditions
  124. 75. # are met:
  125. 76. # 1. Redistributions of source code must retain the above copyright
  126. 77. # notice, this list of conditions and the following disclaimer.
  127. 78. # 2. Redistributions in binary form must reproduce the above copyright
  128. 79. # notice, this list of conditions and the following disclaimer in the
  129. 80. # documentation and/or other materials provided with the distribution.
  130. 81. # 3. Neither the name of the University nor the names of its contributors
  131. 82. # may be used to endorse or promote products derived from this software
  132. 83. # without specific prior written permission.
  133. 84. #
  134. 85. # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  135. 86. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  136. 87. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  137. 88. # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  138. 89. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  139. 90. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  140. 91. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  141. 92. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  142. 93. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  143. 94. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  144. 95. # SUCH DAMAGE.
  145. 96. #
  146. 97. # @(#)wargames.sh 8.1 (Berkeley) 5/31/93
  147. 98. #
  148. 99. echo -n "Would you like to play a game? "
  149. 100. read x a
  150. 101. x=`/storage/sdcard0/Download/basename $x`
  151. 102.
  152. 103. if [ -f /storage/sdcard0/Download/$x ] ; then
  153. 104. tput cl
  154. 105. exec /storage/sdcard0/Download/$x $a
  155. 106. else
  156. 107. echo "A strange game."
  157. 108. echo "The only winning move is not to play."
  158. 109. fi
  159. 110. exit 0
  160. 111. the file basename must be in the directory /storage/sdcard0/Download
  161. 112. to start from shell you must to type: ash wargames and then to push the key enter and/or return
  162. 113. the game wargames works fine but the library basename before the end of the game show a sort of
  163. 114. error i think because initially it was developed for the CISC architecture x86.
  164. 115. It was ported by me on GNU/linux gNewSense and then on Android, who knows how to solve this problem,
  165. 116. is free to release the changes to the library basename for PowerPC architecture (ARM) cpu.
  166. 117. happy hacking !!!!!
  167. 118. Paolo Del Bene
Add Comment
Please, Sign In to add comment