Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NetworkedGraphicsMV3500
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savage
NetworkedGraphicsMV3500
Commits
88567d42
Commit
88567d42
authored
7 months ago
by
tjsus
Browse files
Options
Downloads
Patches
Plain Diff
Assignment 3 code modified to add comment PDU to update player 1 and player 2 grids.
parent
71d7008a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
assignments/src/MV3500Cohort2024JulySeptember/homework3/Smith/ExampleSimulationProgram.java
+2
-2
2 additions, 2 deletions
...lySeptember/homework3/Smith/ExampleSimulationProgram.java
with
2 additions
and
2 deletions
assignments/src/MV3500Cohort2024JulySeptember/homework3/Smith/ExampleSimulationProgram.java
+
2
−
2
View file @
88567d42
...
...
@@ -17,7 +17,7 @@ public class ExampleSimulationProgram {
// Constants for the Battleship game
private
static
final
int
GRID_SIZE
=
10
;
// 10x10 grid for Battleship
private
static
final
int
MAX_TURNS
=
1
00
;
// Limit turns to avoid infinite games
private
static
final
int
MAX_TURNS
=
2
00
;
// Limit turns to avoid infinite games
// Grids for each player
private
char
[][]
player1Grid
=
new
char
[
GRID_SIZE
][
GRID_SIZE
];
...
...
@@ -28,7 +28,7 @@ public class ExampleSimulationProgram {
// Ship positions (simple example positions for each player's ships)
private
final
int
[][]
player1Ships
=
{{
0
,
0
},
{
0
,
1
},
{
0
,
2
}};
// Positions for player 1's ships
private
final
int
[][]
player2Ships
=
{{
5
,
5
},
{
5
,
6
},
{
5
,
7
}};
// Positions for player 2's ships
private
final
int
[][]
player2Ships
=
{{
2
,
5
},
{
2
,
6
},
{
2
,
7
}};
// Positions for player 2's ships
// DIS utilities
private
String
descriptor
=
this
.
getClass
().
getSimpleName
();
...
...
This diff is collapsed.
Click to expand it.
Smith, Timothy (LT)
@timothy.smith
mentioned in commit
fc8db8de
·
7 months ago
mentioned in commit
fc8db8de
mentioned in commit fc8db8de38dbb3441f676124da23cf917bfc1c4b
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment