Battleship Game with Cartesian Coordinates

Battleship Game with Cartesian Coordinates
Loading the math board and drawing, please wait…
2020-08-05 00:51
This example demonstrates a classic Battleship game using Cartesian coordinates, where players guess the hidden positions of a computer's ships by coordinates. The core math concepts involved include coordinate system usage, point position determination, set operations, and conditional logic. The construction leverages GeoGebra commands and objects such as Sequence, Intersection, Zip, If, Join, Shuffle, Polygon, PointIn, RandomElement, Textfield, Segment, TextToUnicode, Defined, Length, Sort, and Corner. It is suitable for middle school students and above to practice and reinforce the application of Cartesian coordinates, enhancing spatial reasoning and logical thinking.

GeoGebra Commands & Parameters

  1. Sequence((x(osubhits(1)), n), n, -5, y(osubhits(1)) - 1, 1) → subtargetsd1
  2. Sequence((x(osubhits(1)), n), n, y(osubhits(1)) + 1, 5, 1) → subtargetsu1
  3. Sequence((n, y(osubhits(1))), n, -5, x(osubhits(1)) - 1, 1) → subtargetsl1
  4. Sequence((n, y(osubhits(1))), n, x(osubhits(1)) + 1, 5, 1) → subtargetsr1
  5. Intersection(subtargetsd1, alloshots \ osubhits) → subtargetsd2
  6. Zip(Segment[osubhits(1), n], n, subtargetsd2) → subtargetlengthsd
  7. If(subtargetlengthdshortest < 2, subtargetlengthdshortest, 2) → subtargetlengthd
  8. Sequence((x(osubhits(1)), y(osubhits(1)) - n), n, 1, subtargetlengthd, 1) → subtargetsd
  9. Intersection(subtargetsu1, alloshots \ osubhits) → subtargetsu2
  10. Zip(Segment[osubhits(1), n], n, subtargetsu2) → subtargetlengthsu
  11. If(subtargetlengthushortest < 2, subtargetlengthushortest, 2) → subtargetlengthu
  12. Sequence((x(osubhits(1)), y(osubhits(1)) + n), n, 1, subtargetlengthu, 1) → subtargetsu
  13. Intersection(Join[{subtargetsu, subtargetsd}], AllPoints) → subtargetsv1
  14. Intersection(subtargetsl1, alloshots \ osubhits) → subtargetsl2
  15. Zip(Segment[osubhits(1), n], n, subtargetsl2) → subtargetlengthsl
  16. If(subtargetlengthlshortest < 2, subtargetlengthlshortest, 2) → subtargetlengthl
  17. Sequence((x(osubhits(1) - n), y(osubhits(1))), n, 1, subtargetlengthl, 1) → subtargetsl
  18. Intersection(subtargetsr1, alloshots \ osubhits) → subtargetsr2
  19. Zip(Segment[osubhits(1), n], n, subtargetsr2) → subtargetlengthsr
  20. If(subtargetlengthrshortest < 2, subtargetlengthrshortest, 2) → subtargetlengthr
  21. Sequence((x(osubhits(1) + n), y(osubhits(1))), n, 1, subtargetlengthr, 1) → subtargetsr
  22. Intersection(Join[{subtargetsr, subtargetsl}], AllPoints) → subtargetsh1
  23. If(Length[subtargetsv1] < 2, {}, If[Length[Intersection[subtargetsh1, osubhits]] > 0, {}, subtargetsv1]) → subtargetsv2
  24. If(Length[subtargetsh1] < 2, {}, If[Length[Intersection[subtargetsv1, osubhits]] > 0, {}, subtargetsh1]) → subtargetsh2
  25. Join({subtargetsh2, subtargetsv2, {(10, 10)}}) → subtargets1
  26. Shuffle(subtargets1) → subtargets2, {(10, 10)}
  27. Sequence((x(odestroyerhits(1)), n), n, -5, y(odestroyerhits(1)) - 1, 1) → destroyertargetsd1
  28. Sequence((x(odestroyerhits(1)), n), n, y(odestroyerhits(1)) + 1, 5, 1) → destroyertargetsu1
  29. Sequence((n, y(odestroyerhits(1))), n, -5, x(odestroyerhits(1)) - 1, 1) → destroyertargetsl1
  30. Sequence((n, y(odestroyerhits(1))), n, x(odestroyerhits(1)) + 1, 5, 1) → destroyertargetsr1
  31. Intersection(destroyertargetsd1, alloshots \ odestroyerhits) → destroyertargetsd2
  32. Zip(Segment[odestroyerhits(1), n], n, destroyertargetsd2) → destroyertargetlengthsd
  33. If(destroyertargetlengthdshortest < 1, destroyertargetlengthdshortest, 1) → destroyertargetlengthd
  34. Sequence((x(odestroyerhits(1)), y(odestroyerhits(1)) - n), n, 1, destroyertargetlengthd, 1) → destroyertargetsd
  35. Intersection(destroyertargetsu1, alloshots \ odestroyerhits) → destroyertargetsu2
  36. Zip(Segment[odestroyerhits(1), n], n, destroyertargetsu2) → destroyertargetlengthsu
  37. If(destroyertargetlengthushortest < 1, destroyertargetlengthushortest, 1) → destroyertargetlengthu
  38. Sequence((x(odestroyerhits(1)), y(odestroyerhits(1)) + n), n, 1, destroyertargetlengthu, 1) → destroyertargetsu
  39. Intersection(Join[{destroyertargetsu, destroyertargetsd}], AllPoints) → destroyertargetsv1
  40. Intersection(destroyertargetsl1, alloshots \ odestroyerhits) → destroyertargetsl2
  41. Zip(Segment[odestroyerhits(1), n], n, destroyertargetsl2) → destroyertargetlengthsl
  42. If(destroyertargetlengthlshortest < 1, destroyertargetlengthlshortest, 1) → destroyertargetlengthl
  43. Sequence((x(odestroyerhits(1) - n), y(odestroyerhits(1))), n, 1, destroyertargetlengthl, 1) → destroyertargetsl
  44. Intersection(destroyertargetsr1, alloshots \ odestroyerhits) → destroyertargetsr2
  45. Zip(Segment[odestroyerhits(1), n], n, destroyertargetsr2) → destroyertargetlengthsr
  46. If(destroyertargetlengthrshortest < 1, destroyertargetlengthrshortest, 1) → destroyertargetlengthr
  47. Sequence((x(odestroyerhits(1) + n), y(odestroyerhits(1))), n, 1, destroyertargetlengthr, 1) → destroyertargetsr
  48. Intersection(Join[{destroyertargetsr, destroyertargetsl}], AllPoints) → destroyertargetsh1
  49. If(Length[destroyertargetsv1] < 1, {}, If[Length[Intersection[destroyertargetsh1, odestroyerhits]] > 0, {}, destroyertargetsv1]) → destroyertargetsv2
  50. If(Length[destroyertargetsh1] < 1, {}, If[Length[Intersection[destroyertargetsv1, odestroyerhits]] > 0, {}, destroyertargetsh1]) → destroyertargetsh2
  51. Join({destroyertargetsh2, destroyertargetsv2, {(10, 10)}}) → destroyertargets1
  52. Shuffle(destroyertargets1) → destroyertargets2, {(10, 10)}
  53. Sequence((x(ocruiserhits(1)), n), n, -5, y(ocruiserhits(1)) - 1, 1) → cruisertargetsd1
  54. Sequence((x(ocruiserhits(1)), n), n, y(ocruiserhits(1)) + 1, 5, 1) → cruisertargetsu1
  55. Sequence((n, y(ocruiserhits(1))), n, -5, x(ocruiserhits(1)) - 1, 1) → cruisertargetsl1
  56. Sequence((n, y(ocruiserhits(1))), n, x(ocruiserhits(1)) + 1, 5, 1) → cruisertargetsr1
  57. Intersection(cruisertargetsd1, alloshots \ ocruiserhits) → cruisertargetsd2
  58. Zip(Segment[ocruiserhits(1), n], n, cruisertargetsd2) → cruisertargetlengthsd
  59. If(cruisertargetlengthdshortest < 2, cruisertargetlengthdshortest, 2) → cruisertargetlengthd
  60. Sequence((x(ocruiserhits(1)), y(ocruiserhits(1)) - n), n, 1, cruisertargetlengthd, 1) → cruisertargetsd
  61. Intersection(cruisertargetsu1, alloshots \ ocruiserhits) → cruisertargetsu2
  62. Zip(Segment[ocruiserhits(1), n], n, cruisertargetsu2) → cruisertargetlengthsu
  63. If(cruisertargetlengthushortest < 2, cruisertargetlengthushortest, 2) → cruisertargetlengthu
  64. Sequence((x(ocruiserhits(1)), y(ocruiserhits(1)) + n), n, 1, cruisertargetlengthu, 1) → cruisertargetsu
  65. Intersection(Join[{cruisertargetsu, cruisertargetsd}], AllPoints) → cruisertargetsv1
  66. Intersection(cruisertargetsl1, alloshots \ ocruiserhits) → cruisertargetsl2
  67. Zip(Segment[ocruiserhits(1), n], n, cruisertargetsl2) → cruisertargetlengthsl
  68. If(cruisertargetlengthlshortest < 2, cruisertargetlengthlshortest, 2) → cruisertargetlengthl
  69. Sequence((x(ocruiserhits(1) - n), y(ocruiserhits(1))), n, 1, cruisertargetlengthl, 1) → cruisertargetsl
  70. Intersection(cruisertargetsr1, alloshots \ ocruiserhits) → cruisertargetsr2
  71. Zip(Segment[ocruiserhits(1), n], n, cruisertargetsr2) → cruisertargetlengthsr
  72. If(cruisertargetlengthrshortest < 2, cruisertargetlengthrshortest, 2) → cruisertargetlengthr
  73. Sequence((x(ocruiserhits(1) + n), y(ocruiserhits(1))), n, 1, cruisertargetlengthr, 1) → cruisertargetsr
  74. Intersection(Join[{cruisertargetsr, cruisertargetsl}], AllPoints) → cruisertargetsh1
  75. If(Length[cruisertargetsv1] < 2, {}, If[Length[Intersection[cruisertargetsh1, ocruiserhits]] > 0, {}, cruisertargetsv1]) → cruisertargetsv2
  76. If(Length[cruisertargetsh1] < 2, {}, If[Length[Intersection[cruisertargetsv1, ocruiserhits]] > 0, {}, cruisertargetsh1]) → cruisertargetsh2
  77. Join({cruisertargetsh2, cruisertargetsv2, {(10, 10)}}) → cruisertargets1
  78. Shuffle(cruisertargets1) → cruisertargets2, {(10, 10)}
  79. Sequence((x(ocarrierhits(1)), n), n, -5, y(ocarrierhits(1)) - 1, 1) → carriertargetsd1
  80. Sequence((x(ocarrierhits(1)), n), n, y(ocarrierhits(1)) + 1, 5, 1) → carriertargetsu1
  81. Sequence((n, y(ocarrierhits(1))), n, -5, x(ocarrierhits(1)) - 1, 1) → carriertargetsl1
  82. Sequence((n, y(ocarrierhits(1))), n, x(ocarrierhits(1)) + 1, 5, 1) → carriertargetsr1
  83. Intersection(carriertargetsd1, alloshots \ ocarrierhits) → carriertargetsd2
  84. Zip(Segment[ocarrierhits(1), n], n, carriertargetsd2) → carriertargetlengthsd
  85. If(carriertargetlengthdshortest < 4, carriertargetlengthdshortest, 4) → carriertargetlengthd
  86. Sequence((x(ocarrierhits(1)), y(ocarrierhits(1)) - n), n, 1, carriertargetlengthd, 1) → carriertargetsd
  87. Intersection(carriertargetsu1, alloshots \ ocarrierhits) → carriertargetsu2
  88. Zip(Segment[ocarrierhits(1), n], n, carriertargetsu2) → carriertargetlengthsu
  89. If(carriertargetlengthushortest < 4, carriertargetlengthushortest, 4) → carriertargetlengthu
  90. Sequence((x(ocarrierhits(1)), y(ocarrierhits(1)) + n), n, 1, carriertargetlengthu, 1) → carriertargetsu
  91. Intersection(Join[{carriertargetsu, carriertargetsd}], AllPoints) → carriertargetsv1
  92. Intersection(carriertargetsl1, alloshots \ ocarrierhits) → carriertargetsl2
  93. Zip(Segment[ocarrierhits(1), n], n, carriertargetsl2) → carriertargetlengthsl
  94. If(carriertargetlengthlshortest < 4, carriertargetlengthlshortest, 4) → carriertargetlengthl
  95. Sequence((x(ocarrierhits(1) - n), y(ocarrierhits(1))), n, 1, carriertargetlengthl, 1) → carriertargetsl
  96. Intersection(carriertargetsr1, alloshots \ ocarrierhits) → carriertargetsr2
  97. Zip(Segment[ocarrierhits(1), n], n, carriertargetsr2) → carriertargetlengthsr
  98. If(carriertargetlengthrshortest < 4, carriertargetlengthrshortest, 4) → carriertargetlengthr
  99. Sequence((x(ocarrierhits(1) + n), y(ocarrierhits(1))), n, 1, carriertargetlengthr, 1) → carriertargetsr
  100. Intersection(Join[{carriertargetsr, carriertargetsl}], AllPoints) → carriertargetsh1
  101. If(Length[carriertargetsv1] < 4, {}, If[Length[Intersection[carriertargetsh1, ocarrierhits]] > 0, {}, carriertargetsv1]) → carriertargetsv2
  102. If(Length[carriertargetsh1] < 4, {}, If[Length[Intersection[carriertargetsv1, ocarrierhits]] > 0, {}, carriertargetsh1]) → carriertargetsh2
  103. Join({carriertargetsh2, carriertargetsv2, {(10, 10)}}) → carriertargets1
  104. Shuffle(carriertargets1) → carriertargets2, {(10, 10)}
  105. Sequence((x(obattlehits(1)), n), n, -5, y(obattlehits(1)) - 1, 1) → battletargetsd1
  106. Sequence((x(obattlehits(1)), n), n, y(obattlehits(1)) + 1, 5, 1) → battletargetsu1
  107. Sequence((n, y(obattlehits(1))), n, -5, x(obattlehits(1)) - 1, 1) → battletargetsl1
  108. Sequence((n, y(obattlehits(1))), n, x(obattlehits(1)) + 1, 5, 1) → battletargetsr1
  109. Intersection(battletargetsd1, alloshots \ obattlehits) → battletargetsd2
  110. Zip(Segment[obattlehits(1), n], n, battletargetsd2) → battletargetlengthsd
  111. If(battletargetlengthdshortest < 3, battletargetlengthdshortest, 3) → battletargetlengthd
  112. Sequence((x(obattlehits(1)), y(obattlehits(1)) - n), n, 1, battletargetlengthd, 1) → battletargetsd
  113. Intersection(battletargetsu1, alloshots \ obattlehits) → battletargetsu2
  114. Zip(Segment[obattlehits(1), n], n, battletargetsu2) → battletargetlengthsu
  115. If(battletargetlengthushortest < 3, battletargetlengthushortest, 3) → battletargetlengthu
  116. Sequence((x(obattlehits(1)), y(obattlehits(1)) + n), n, 1, battletargetlengthu, 1) → battletargetsu
  117. Intersection(Join[{battletargetsu, battletargetsd}], AllPoints) → battletargetsv1
  118. Intersection(battletargetsl1, alloshots \ obattlehits) → battletargetsl2
  119. Zip(Segment[obattlehits(1), n], n, battletargetsl2) → battletargetlengthsl
  120. If(battletargetlengthlshortest < 3, battletargetlengthlshortest, 3) → battletargetlengthl
  121. Sequence((x(obattlehits(1) - n), y(obattlehits(1))), n, 1, battletargetlengthl, 1) → battletargetsl
  122. Intersection(battletargetsr1, alloshots \ obattlehits) → battletargetsr2
  123. Zip(Segment[obattlehits(1), n], n, battletargetsr2) → battletargetlengthsr
  124. If(battletargetlengthrshortest < 3, battletargetlengthrshortest, 3) → battletargetlengthr
  125. Sequence((x(obattlehits(1) + n), y(obattlehits(1))), n, 1, battletargetlengthr, 1) → battletargetsr
  126. Intersection(Join[{battletargetsr, battletargetsl}], AllPoints) → battletargetsh1
  127. If(Length[battletargetsv1] < 3, {}, If[Length[Intersection[battletargetsh1, obattlehits]] > 0, {}, battletargetsv1]) → battletargetsv2
  128. If(Length[battletargetsh1] < 3, {}, If[Length[Intersection[battletargetsv1, obattlehits]] > 0, {}, battletargetsh1]) → battletargetsh2
  129. Join({battletargetsh2, battletargetsv2, {(10, 10)}}) → battletargets1
  130. Shuffle(battletargets1) → battletargets2, {(10, 10)}
  131. Polygon(E, F, G, H) → q2, e, f, g, h
  132. Polygon(A, B, C, D) → q1, a, b, c, d
  133. PointIn(q2) → sub
  134. If(suborient, {sub + (0, 0), sub + (1, 0), sub + (2, 0)}, {sub + (0, 0), sub + (0, 1), sub + (0, 2)}) → subpoints
  135. PointIn(q2) → carrier
  136. If(carrierorient, {carrier + (0, 0), carrier + (1, 0), carrier + (2, 0), carrier + (3, 0), carrier + (4, 0)}, {carrier + (0, 0), carrier + (0, 1), carrier + (0, 2), carrier + (0, 3), carrier + (0, 4)}) → carrierpoints
  137. PointIn(q2) → battle
  138. If(battleorient, {battle + (0, 0), battle + (1, 0), battle + (2, 0), battle + (3, 0)}, {battle + (0, 0), battle + (0, 1), battle + (0, 2), battle + (0, 3)}) → battlepoints
  139. PointIn(q2) → cruiser
  140. If(cruiserorient, {cruiser + (0, 0), cruiser + (1, 0), cruiser + (2, 0)}, {cruiser + (0, 0), cruiser + (0, 1), cruiser + (0, 2)}) → cruiserpoints
  141. PointIn(q2) → destroyer
  142. If(destroyerorient, {destroyer + (0, 0), destroyer + (1, 0)}, {destroyer + (0, 0), destroyer + (0, 1)}) → destroyerpoints
  143. Join({subpoints, cruiserpoints, destroyerpoints, carrierpoints, battlepoints}) → AllShipPoints
  144. RandomElement(AllPoints) → battleo
  145. RandomElement(AllPoints) → carriero
  146. RandomElement(AllPoints) → cruisero
  147. RandomElement(AllPoints) → destroyero
  148. RandomElement(AllPoints) → subo
  149. If(battleoorient, {battleo + (0, 0), battleo + (1, 0), battleo + (2, 0), battleo + (3, 0)}, {battleo + (0, 0), battleo + (0, 1), battleo + (0, 2), battleo + (0, 3)}) → battleopoints
  150. If(carrieroorient, {carriero + (0, 0), carriero + (1, 0), carriero + (2, 0), carriero + (3, 0), carriero + (4, 0)}, {carriero + (0, 0), carriero + (0, 1), carriero + (0, 2), carriero + (0, 3), carriero + (0, 4)}) → carrieropoints
  151. If(cruiseroorient, {cruisero + (0, 0), cruisero + (1, 0), cruisero + (2, 0)}, {cruisero + (0, 0), cruisero + (0, 1), cruisero + (0, 2)}) → cruiseropoints
  152. If(destroyeroorient, {destroyero + (0, 0), destroyero + (1, 0)}, {destroyero + (0, 0), destroyero + (0, 1)}) → destroyeropoints
  153. If(suboorient, {subo + (0, 0), subo + (1, 0), subo + (2, 0)}, {subo + (0, 0), subo + (0, 1), subo + (0, 2)}) → subopoints
  154. Join({battleopoints, carrieropoints, cruiseropoints, destroyeropoints, subopoints}) → AllShipoPoints
  155. Textfield(empty) → InputBox1
  156. Segment(battleopoints(1), battleopoints(4)) → battleosink
  157. Segment(carrieropoints(1), carrieropoints(5)) → carrierosink
  158. Segment(cruiseropoints(1), cruiseropoints(3)) → cruiserosink
  159. Segment(destroyeropoints(1), destroyeropoints(2)) → destroyerosink
  160. Segment(subopoints(1), subopoints(3)) → subosink
  161. TextToUnicode(empty) → InputUnicode
  162. Defined(IndexOf[44, InputUnicode]) → inputcomma
  163. Length(GuessRemain) → i
  164. Polygon(I, J, K, L) → q3, i_1, j, k, l
  165. Segment(carrierpoints(1), carrierpoints(5)) → carrierline
  166. Segment(battlepoints(1), battlepoints(4)) → battleline
  167. Segment(subpoints(1), subpoints(3)) → subline
  168. Segment(cruiserpoints(1), cruiserpoints(3)) → cruiserline
  169. Segment(destroyerpoints(1), destroyerpoints(2)) → destroyerline
  170. Segment(carrierpoints(1), carrierpoints(5)) → carriersink
  171. Segment(battlepoints(1), battlepoints(4)) → battlesink
  172. Segment(subpoints(1), subpoints(3)) → subsink
  173. Segment(cruiserpoints(1), cruiserpoints(3)) → cruisersink
  174. Segment(destroyerpoints(1), destroyerpoints(2)) → destroyersink
  175. If(carrierorient, {(-0.5, -0.4), (4.5, -0.5), (-0.5, 0.5)}, {(-0.4, -0.5), (-0.5, 4.5), (0.5, -0.5)}) → carrierpic
  176. If(battleorient, {(-0.5, -0.4), (3.5, -0.4), (-0.5, 0.4)}, {(-0.4, -0.5), (-0.4, 3.5), (0.4, -0.5)}) → battlepic
  177. If(suborient, {(-0.5, -0.3), (2.5, -0.3), (-0.5, 0.3)}, {(-0.3, -0.5), (-0.3, 2.5), (0.3, -0.5)}) → subpic
  178. If(cruiserorient, {(-0.5, -0.3), (2.5, -0.3), (-0.5, 0.3)}, {(-0.3, -0.5), (-0.3, 2.5), (0.3, -0.5)}) → cruiserpic
  179. If(destroyerorient, {(-0.5, -0.3), (1.5, -0.3), (-0.5, 0.3)}, {(-0.3, -0.5), (-0.3, 1.5), (0.3, -0.5)}) → destroyerpic
  180. Zip(Length[Segment[ocarrierhits(1), n]], n, carriertargets2) → carriertargets3
  181. Sort(carriertargets2, carriertargets3) → carriertargets4
  182. Zip(Length[Segment[obattlehits(1), n]], n, battletargets2) → battletargets3
  183. Sort(battletargets2, battletargets3) → battletargets4
  184. Zip(Length[Segment[ocruiserhits(1), n]], n, cruisertargets2) → cruisertargets3
  185. Sort(cruisertargets2, cruisertargets3) → cruisertargets4
  186. Zip(Length[Segment[osubhits(1), n]], n, subtargets2) → subtargets3
  187. Sort(subtargets2, subtargets3) → subtargets4
  188. Zip(Length[Segment[odestroyerhits(1), n]], n, destroyertargets2) → destroyertargets3
  189. Sort(destroyertargets2, destroyertargets3) → destroyertargets4
  190. Zip(Text[explosion, p - (0.6, 0.3)], p, obattlehits) → battleexplosion
  191. Zip(Text[explosion, p - (0.6, 0.3)], p, ocarrierhits) → carrierexplosion
  192. Zip(Text[explosion, p - (0.6, 0.3)], p, ocruiserhits) → cruiserexplosion
  193. Zip(Text[explosion, p - (0.6, 0.3)], p, odestroyerhits) → destroyerexplosion
  194. Zip(Text[explosion, p - (0.6, 0.3)], p, osubhits) → subexplosion
  195. If(battleoorient, {(-0.5, -0.4), (3.5, -0.4), (-0.5, 0.4)}, {(-0.4, -0.5), (-0.4, 3.5), (0.4, -0.5)}) → battleopic
  196. If(carrieroorient, {(-0.5, -0.4), (4.5, -0.5), (-0.5, 0.5)}, {(-0.4, -0.5), (-0.5, 4.5), (0.5, -0.5)}) → carrieropic
  197. If(cruiseroorient, {(-0.5, -0.3), (2.5, -0.3), (-0.5, 0.3)}, {(-0.3, -0.5), (-0.3, 2.5), (0.3, -0.5)}) → cruiseropic
  198. If(destroyeroorient, {(-0.5, -0.3), (1.5, -0.3), (-0.5, 0.3)}, {(-0.3, -0.5), (-0.3, 1.5), (0.3, -0.5)}) → destroyeropic
  199. If(suboorient, {(-0.5, -0.3), (2.5, -0.3), (-0.5, 0.3)}, {(-0.3, -0.5), (-0.3, 2.5), (0.3, -0.5)}) → subopic
  200. Corner(5) → dims

AI Drawing Prompt Reference

Draw a Battleship game scene on a Cartesian coordinate system. Players guess the hidden ship positions by coordinates. First, plot multiple coordinate points as potential shooting targets. Then, based on the players' shooting results, draw segments of varying lengths around the corresponding coordinates to indicate hits or misses. Finally, connect all hit points to form a closed area and place a marker point at the center to show the ship's location.
The prompt above was compiled from the original drawing commands and is for reference only.