-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample_input_output.cpp
More file actions
580 lines (422 loc) · 25.6 KB
/
sample_input_output.cpp
File metadata and controls
580 lines (422 loc) · 25.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
//Initial interface
//output:
____________________ _____ __________ ______________________________________.____ ________ _____ _____ ___________
/ _____/\_ _____/ / _ \ \______ \ / _ \__ ___/\__ ___/\_ _____/| | / _____/ / _ \ / \ \_ _____/
\_____ \ | __)_ / /_\ \ | | _/ / /_\ \| | | | | __)_ | | / \ ___ / /_\ \ / \ / \ | __)_
/ \ | \/ | \ | | \/ | \ | | | | \| |___ \ \_\ \/ | \/ Y \| \
/_______ //_______ /\____|__ / |______ /\____|__ /____| |____| /_______ /|_______ \ \______ /\____|__ /\____|__ /_______ /
\/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
Welcome to the Seabattle game (Author: Tu Yuanyang & He Jiachuan)
1: Play!
2: Instruction
3: Quit
//input:
2
//The Instruction is showed below
//output:
Battleship game is a strategy type gussing game.
It is typically played on square and ruled grids on which each player's fleet of battleships are marked.
The locations of the fleets are concealed from the other player.
Players alternate turns calling attacks at the grid which marks the other player's ships, and the objective of the game is to destroy the opposing player's fleet.
This game has 2 modes:
Mode 1: Play Against AI
Mode 2: Challenge Mode
Detailed machenisms of each mode will be introduced befor the game start.
ENJOY AND GET READY FOR THE WAR CAPITAN!
Enter anything except 3 to Play, or enter 3 to if you want quit.
//input anything except 3 and it will go back to the menu
//output:
____________________ _____ __________ ______________________________________.____ ________ _____ _____ ___________
/ _____/\_ _____/ / _ \ \______ \ / _ \__ ___/\__ ___/\_ _____/| | / _____/ / _ \ / \ \_ _____/
\_____ \ | __)_ / /_\ \ | | _/ / /_\ \| | | | | __)_ | | / \ ___ / /_\ \ / \ / \ | __)_
/ \ | \/ | \ | | \/ | \ | | | | \| |___ \ \_\ \/ | \/ Y \| \
/_______ //_______ /\____|__ / |______ /\____|__ /____| |____| /_______ /|_______ \ \______ /\____|__ /\____|__ /_______ /
\/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
Choosing Mode:
1: Fight Against AI
2: Challenge Mode
3: Quit
//input:
1
//output:
This is the typical game play of Battleship game.
In this mode, player's opponent is a computer, with difficulty **Easy, Normal, Hard, Impossible.**
Player randomly generate (either horizontally or vertically and at random spots) his ships on a 10 x 10 board
Types of ships avaliable for the player (with allowed amount):
- Aircraft Carrier, 6 units (0~3)
- Battleship, 5 units (0~3)
- Cruiser, 4 units (0~5)
- Destroyer, 3 units (0~5)
- Submarine, 2 units (0~5)
Your win goal is to defeat the enemy fleet, otherwise you lose.
Choosing Difficulty:
1: EASY
2: NORMAL
3: HARD
4: IMPOSSIBLE
//input:
4
//output:
YOU CHOOSE 4: IMPOSSIBLE MODE
Please choose the number of ships ( both yours and AI's )
1.Default ( 1 for each type of ship )
2.Customize
//input:
2
//output:
//Then, the battle start
//output:
The enemy fleet was found! Destroy them or we will die!
Your Fleet: Enemy's Fleet:
1 2 3 4 5 6 7 8 9 10 (x) 1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 1 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
3 | 2 | 2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 3 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
4 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 4 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
5 | ~ | ~ | ~ | ~ | ~ | 3 | 3 | 3 | 3 | ~ | 5 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 3 | ~ | 6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
7 | 4 | 4 | 4 | 4 | ~ | ~ | ~ | ~ | 3 | ~ | 7 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | 6 | 6 | 6 | 6 | 6 | 6 | ~ | ~ | 9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y) (y)
Your fleet: Submarine(2) = 1 Destoryer(3) = 2 Cruiser(4) = 1 Battleship(5) = 0 Carrier(6) = 1
Enemy fleet: Submarine(2) = 1 Destoryer(3) = 2 Cruiser(4) = 1 Battleship(5) = 0 Carrier(6) = 1
Choose position to attack (x y):
//input:
1 5
//output:
Missed! ( 1 , 5 )
Your ship has been shot! ( 3 , 1 )
Your Fleet: Enemy's Fleet:
1 2 3 4 5 6 7 8 9 10 (x) 1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 1 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
3 | X | 2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 3 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
4 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 4 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
5 | ~ | ~ | ~ | ~ | ~ | 3 | 3 | 3 | 3 | ~ | 5 | O | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 3 | ~ | 6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
7 | 4 | 4 | 4 | 4 | ~ | ~ | ~ | ~ | 3 | ~ | 7 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | 6 | 6 | 6 | 6 | 6 | 6 | ~ | ~ | 9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y) (y)
Your fleet: Submarine(2) = 1 Destoryer(3) = 2 Cruiser(4) = 1 Battleship(5) = 0 Carrier(6) = 1
Enemy fleet: Submarine(2) = 1 Destoryer(3) = 2 Cruiser(4) = 1 Battleship(5) = 0 Carrier(6) = 1
Choose position to attack (x y):
//input:
2 4
//output:
Missed! ( 2 , 4 )
Your ship has been shot! ( 5 , 6 )
Your Fleet: Enemy's Fleet:
1 2 3 4 5 6 7 8 9 10 (x) 1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 1 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
3 | X | 2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 3 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
4 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 4 | ~ | O | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
5 | ~ | ~ | ~ | ~ | ~ | X | 3 | 3 | 3 | ~ | 5 | O | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 3 | ~ | 6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
7 | 4 | 4 | 4 | 4 | ~ | ~ | ~ | ~ | 3 | ~ | 7 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | 6 | 6 | 6 | 6 | 6 | 6 | ~ | ~ | 9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y) (y)
Your fleet: Submarine(2) = 1 Destoryer(3) = 2 Cruiser(4) = 1 Battleship(5) = 0 Carrier(6) = 1
Enemy fleet: Submarine(2) = 1 Destoryer(3) = 2 Cruiser(4) = 1 Battleship(5) = 0 Carrier(6) = 1
Choose position to attack (x y):
//after 8 shots, we first shot an enmy ship
//output:
Right on Target! ( 8 , 5 )
Your ship has been shot! ( 5 , 9 )
Your Fleet: Enemy's Fleet:
1 2 3 4 5 6 7 8 9 10 (x) 1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 1 | ~ | ~ | ~ | ~ | O | ~ | ~ | ~ | ~ | ~ |
2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 2 | ~ | ~ | ~ | O | ~ | ~ | ~ | ~ | ~ | ~ |
3 | X | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 3 | ~ | ~ | O | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
4 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 4 | ~ | O | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
5 | ~ | ~ | ~ | ~ | ~ | X | X | X | X | ~ | 5 | O | ~ | ~ | ~ | ~ | ~ | ~ | X | ~ | ~ |
6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | X | ~ | 6 | ~ | ~ | ~ | ~ | ~ | ~ | O | ~ | ~ | ~ |
7 | 4 | X | 4 | 4 | ~ | ~ | ~ | ~ | 3 | ~ | 7 | ~ | ~ | ~ | ~ | ~ | O | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | 6 | 6 | 6 | 6 | 6 | 6 | ~ | ~ | 9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y) (y)
Your fleet: Submarine(2) = 0 Destoryer(3) = 1 Cruiser(4) = 1 Battleship(5) = 0 Carrier(6) = 1
Enemy fleet: Submarine(2) = 1 Destoryer(3) = 2 Cruiser(4) = 1 Battleship(5) = 0 Carrier(6) = 1
Choose position to attack (x y):
//A few shots later, we sunk an enmy destroyer
//output:
Right on Target! ( 6 , 5 )
Your ship has been shot! ( 9 , 7 )
You sank an enemy Destoryer !
Your Fleet: Enemy's Fleet:
1 2 3 4 5 6 7 8 9 10 (x) 1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 1 | ~ | ~ | ~ | ~ | O | ~ | ~ | ~ | ~ | ~ |
2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 2 | ~ | ~ | ~ | O | ~ | ~ | ~ | ~ | ~ | ~ |
3 | X | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 3 | ~ | ~ | O | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
4 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 4 | ~ | O | ~ | ~ | ~ | ~ | ~ | O | ~ | ~ |
5 | ~ | ~ | ~ | ~ | ~ | X | X | X | X | ~ | 5 | O | ~ | ~ | ~ | ~ | X | X | X | X | O |
6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | X | ~ | 6 | ~ | ~ | ~ | ~ | ~ | ~ | O | O | ~ | ~ |
7 | X | X | X | X | ~ | ~ | ~ | ~ | X | ~ | 7 | ~ | ~ | ~ | ~ | ~ | O | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | 6 | 6 | X | X | X | 6 | ~ | ~ | 9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | O | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y) (y)
Your fleet: Submarine(2) = 0 Destoryer(3) = 0 Cruiser(4) = 0 Battleship(5) = 0 Carrier(6) = 1
Enemy fleet: Submarine(2) = 1 Destoryer(3) = 1 Cruiser(4) = 1 Battleship(5) = 0 Carrier(6) = 1
Choose position to attack (x y):
//we shot a position that shot before
//input:
2 4
//outpt:
Denied, The Position Has been Shot.
Your Fleet: Enemy's Fleet:
1 2 3 4 5 6 7 8 9 10 (x) 1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 1 | ~ | ~ | ~ | ~ | O | ~ | ~ | ~ | ~ | ~ |
2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 2 | ~ | ~ | ~ | O | ~ | ~ | ~ | ~ | ~ | ~ |
3 | X | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 3 | ~ | ~ | O | ~ | ~ | ~ | O | ~ | ~ | ~ |
4 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 4 | ~ | O | ~ | ~ | ~ | ~ | ~ | O | ~ | ~ |
5 | ~ | ~ | ~ | ~ | ~ | X | X | X | X | ~ | 5 | O | ~ | ~ | ~ | ~ | X | X | X | X | O |
6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | X | ~ | 6 | ~ | ~ | ~ | ~ | ~ | ~ | O | O | ~ | ~ |
7 | X | X | X | X | ~ | ~ | ~ | ~ | X | ~ | 7 | ~ | ~ | ~ | ~ | ~ | O | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | 6 | 6 | X | X | X | X | ~ | ~ | 9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | O | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y) (y)
Your fleet: Submarine(2) = 0 Destoryer(3) = 0 Cruiser(4) = 0 Battleship(5) = 0 Carrier(6) = 1
Enemy fleet: Submarine(2) = 1 Destoryer(3) = 1 Cruiser(4) = 1 Battleship(5) = 0 Carrier(6) = 1
Choose position to attack (x y):
//after two shots, our fleet is sunk by the "IMPOSSIBLE MODE" AI
//output:
Missed! ( 1 , 2 )
Your ship has been shot! ( 9 , 4 )
Your Fleet: Enemy's Fleet:
1 2 3 4 5 6 7 8 9 10 (x) 1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 1 | ~ | ~ | ~ | ~ | O | ~ | ~ | ~ | ~ | ~ |
2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 2 | O | O | ~ | O | ~ | ~ | ~ | ~ | ~ | ~ |
3 | X | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 3 | ~ | ~ | O | ~ | ~ | ~ | O | ~ | ~ | ~ |
4 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 4 | ~ | O | ~ | ~ | ~ | ~ | ~ | O | ~ | ~ |
5 | ~ | ~ | ~ | ~ | ~ | X | X | X | X | ~ | 5 | O | ~ | ~ | ~ | ~ | X | X | X | X | O |
6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | X | ~ | 6 | ~ | ~ | ~ | ~ | ~ | ~ | O | O | ~ | ~ |
7 | X | X | X | X | ~ | ~ | ~ | ~ | X | ~ | 7 | ~ | ~ | ~ | ~ | ~ | O | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | X | X | X | X | X | X | ~ | ~ | 9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | O | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | 10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y) (y)
Your Fleet is Defeated
You lost.
Choose an option:
1. Go Back to menu
2. Quit
//Then, we want to go back to menu to play challenge mode
//input:
1
//output:
____________________ _____ __________ ______________________________________.____ ________ _____ _____ ___________
/ _____/\_ _____/ / _ \ \______ \ / _ \__ ___/\__ ___/\_ _____/| | / _____/ / _ \ / \ \_ _____/
\_____ \ | __)_ / /_\ \ | | _/ / /_\ \| | | | | __)_ | | / \ ___ / /_\ \ / \ / \ | __)_
/ \ | \/ | \ | | \/ | \ | | | | \| |___ \ \_\ \/ | \/ Y \| \
/_______ //_______ /\____|__ / |______ /\____|__ /____| |____| /_______ /|_______ \ \______ /\____|__ /\____|__ /_______ /
\/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
Choosing Mode:
1: Fight Against AI
2: Challenge Mode
3: Quit
//input:
2
//output:
Challenge mode is an alternative game play of Seabattle game we came up
In challenge mode, you only have limited amount of shells (60) to defeat the enemy fleet
You don't have a fleet, instead, you are defending your base from enemy's attack
The enemy fleet contains only one of the each type of ship
They are:
1 Submarine: 2 units
1 Destoryer: 3 units
1 Cruiser: 4 units
1 Battleship: 5 units
1 Carrier: 6 units
If you defeat the enemy fleet within the limited shells, you win!
Otherwise, if you are ran out of shells and there are still enemy ships left, the game failed :(
Each of the winning game play will be recorded, and your record will be ranked by the amount of shells you use.
The record will be stored in a txt file and you can call/read it in the game.
Choose an option:
1. Enter 1 to start
2. Enter anything else to see your local record
//We want to see the record (but there are no records before on the server)
//input:
2
//output:
Ranking (shells consumed) Date
1. empty
2. empty
3. empty
4. empty
5. empty
6. empty
7. empty
8. empty
9. empty
10.empty
Choose an option:
1. Enter 1 to start
2. Enter anything else to see your local record
//we input 1 to start this mode
//input:
1
//output:
Destroy The Enemy Fleet and Protect Our Base!
1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
3 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
4 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
5 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
7 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y)
Enemy fleet: Submarine(2) = 1 Destoryer(3) = 1 Cruiser(4) = 1 Battleship(5) = 1 Carrier(6) = 1
60 shells left, 0 hit.
Choose position to attack (x y):
//input:
2 1
//output:
Missed!
1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | O | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
2 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
3 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
4 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
5 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
7 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y)
Enemy fleet: Submarine(2) = 1 Destoryer(3) = 1 Cruiser(4) = 1 Battleship(5) = 1 Carrier(6) = 1
59 shells left, 0 hit.
Choose position to attack (x y):
//input:
3 2
//output:
Right on Target!
1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | O | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
2 | ~ | ~ | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
3 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
4 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
5 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
7 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y)
Enemy fleet: Submarine(2) = 1 Destoryer(3) = 1 Cruiser(4) = 1 Battleship(5) = 1 Carrier(6) = 1
58 shells left, 1 hit.
Choose position to attack (x y):
//We sunk an enemy battleship in 8 shots!
//output:
Right on Target!
Good job capitan, you have sank an Battleship !
1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | O | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
2 | ~ | O | X | O | ~ | ~ | ~ | ~ | ~ | ~ |
3 | ~ | ~ | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
4 | ~ | ~ | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
5 | ~ | ~ | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
7 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y)
Enemy fleet: Submarine(2) = 1 Destoryer(3) = 1 Cruiser(4) = 1 Battleship(5) = 0 Carrier(6) = 1
52 shells left, 5 hit.
Choose position to attack (x y):
//output:
Right on Target!
Good job capitan, you have sank an Cruiser !
1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | O | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
2 | O | O | X | O | ~ | ~ | ~ | ~ | ~ | ~ |
3 | ~ | O | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
4 | O | ~ | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
5 | O | ~ | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
6 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
7 | X | X | X | X | ~ | ~ | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y)
Enemy fleet: Submarine(2) = 1 Destoryer(3) = 1 Cruiser(4) = 0 Battleship(5) = 0 Carrier(6) = 1
44 shells left, 9 hit.
Choose position to attack (x y):
//output:
Right on Target!
Good job capitan, you have sank an Submarine !
1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | O | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
2 | O | O | X | O | ~ | ~ | ~ | ~ | ~ | ~ |
3 | ~ | O | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
4 | O | X | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
5 | O | X | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
6 | ~ | O | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
7 | X | X | X | X | ~ | ~ | ~ | ~ | ~ | ~ |
8 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
9 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
10 | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
(y)
Enemy fleet: Submarine(2) = 0 Destoryer(3) = 1 Cruiser(4) = 0 Battleship(5) = 0 Carrier(6) = 1
41 shells left, 11 hit.
Choose position to attack (x y):
//output:
Right on Target!
Good job capitan, you have sank an Carrier !
1 2 3 4 5 6 7 8 9 10 (x)
1 | ~ | O | X | X | X | X | X | X | X | X |
2 | O | O | X | O | ~ | ~ | ~ | ~ | ~ | ~ |
3 | ~ | O | X | ~ | O | O | ~ | ~ | ~ | ~ |
4 | O | X | X | O | ~ | ~ | ~ | ~ | ~ | ~ |
5 | O | X | X | ~ | ~ | ~ | ~ | ~ | ~ | ~ |
6 | ~ | O | ~ | O | O | O | ~ | ~ | ~ | ~ |
7 | X | X | X | X | ~ | ~ | ~ | ~ | ~ | ~ |
8 | ~ | ~ | O | ~ | O | ~ | ~ | O | ~ | ~ |
9 | O | ~ | ~ | O | ~ | ~ | O | ~ | ~ | O |
10 | ~ | ~ | O | ~ | ~ | O | ~ | ~ | O | ~ |
(y)
Enemy fleet: Submarine(2) = 0 Destoryer(3) = 1 Cruiser(4) = 0 Battleship(5) = 0 Carrier(6) = 0
18 shells left, 18 hit.
Choose position to attack (x y):
//Finally, we sunk the enemy fleet in 42 shots
//output:
Right on Target!
You Have Sanked Enemy Fleet!
The Victory is Yours!
The order you sunk the Enemy ships is:
Battleship
Cruiser
Destroyer
Submarine
Carrier
Choose an option:
1. Play Against the AI
2. Play Challenge Mode Again!
3. Quit
4. Enter Anything Else to See the Local Record
//Then, we quit the game
//input:
3
//output:
/$$ /$$ /$$$$$$ /$$ /$$ /$$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$$$$$$$ /$$$$$$$ /$$$$$$ /$$ /$$ /$$$
| $$ | $$ /$$__ $$| $$ | $$| $$_____/ /$$__ $$ | $$$ | $$|_ $$_/ /$$__ $$| $$_____/ | $$__ $$ /$$__ $$| $$ /$$/ |_ $$
| $$ | $$| $$ \ $$| $$ | $$| $$ | $$ \ $$ | $$$$| $$ | $$ | $$ \__/| $$ | $$ \ $$| $$ \ $$ \ $$ /$$/ /$$ \ $$
| $$$$$$$$| $$$$$$$$| $$ / $$/| $$$$$ | $$$$$$$$ | $$ $$ $$ | $$ | $$ | $$$$$ | $$ | $$| $$$$$$$$ \ $$$$/ |__/ | $$
| $$__ $$| $$__ $$ \ $$ $$/ | $$__/ | $$__ $$ | $$ $$$$ | $$ | $$ | $$__/ | $$ | $$| $$__ $$ \ $$/ | $$
| $$ | $$| $$ | $$ \ $$$/ | $$ | $$ | $$ | $$\ $$$ | $$ | $$ $$| $$ | $$ | $$| $$ | $$ | $$ /$$ /$$/
| $$ | $$| $$ | $$ \ $/ | $$$$$$$$ | $$ | $$ | $$ \ $$ /$$$$$$| $$$$$$/| $$$$$$$$ | $$$$$$$/| $$ | $$ | $$ |__/ /$$$/
|__/ |__/|__/ |__/ \_/ |________/ |__/ |__/ |__/ \__/|______/ \______/ |________/ |_______/ |__/ |__/ |__/ |___/