Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The output should look like the photo but it's not complete. I need a Java code. Funky Board Game Design and implement a funky board
The output should look like the photo but it's not complete. I need a Java code. Funky Board Game Design and implement a funky board game. Please see the intro video. Tokens will take turns to move on the board. logic provided in the demo code When there is only one token left on the board it wins the game. Create a game board. The size of the board can be passed in as a parameter. Similar to TicTacToe Board in MP Create a FunkyToken class: Users can pass in the token symbol they want to use. All token pieces should be able to move. Create sub classes: MoveOneToken and RandomToken. MoveOneToken will move at a random direction, but will only move one space at a time. If the token is going to move out of the board, it will try a different direction and move again. If the spot already has a token, it will be replaced and removed from the board. RandomToken will move to any random spot on the board. If the spot already has a token, it will be replaced and removed from the board. Use the provided FunkyGameDemo code to test run your program. Copy and paste the output of your program to a txt file and submit it with your source code just like the machine problems. package FunkyGame; public class FunkyGameDemo public static void mainString args TODO Autogenerated method stub FunkyToken winner null; FunkyBoard board new FunkyBoard; FunkyToken tokens new FunkyToken; tokens new RandomToken@; tokens new MoveOneToken$; tokens new RandomToken&; board.placeTokentokens; board.placeTokentokens; board.placeTokentokens; board.displayBoard; do for int i ; i tokens.length; i if tokensiactive tokensimoveboard; System.out.printlntokensitoken "move"; board.displayBoard; winner board.getWinner; if winner null break; while winner null; System.out.printlnwinnertoken won!";
The output should look like the photo but it's not complete. I need a Java code. Funky Board Game
Design and implement a funky board game. Please see the intro video.
Tokens will take turns to move on the board. logic provided in the demo code When there is
only one token left on the board it wins the game.
Create a game board. The size of the board can be passed in as a parameter. Similar to
TicTacToe Board in MP
Create a FunkyToken class:
Users can pass in the token symbol they want to use.
All token pieces should be able to move.
Create sub classes: MoveOneToken and RandomToken.
MoveOneToken will move at a random direction, but will only move one space at a time.
If the token is going to move out of the board, it will try a different direction and move
again. If the spot already has a token, it will be replaced and removed from the board.
RandomToken will move to any random spot on the board. If the spot already has a
token, it will be replaced and removed from the board.
Use the provided FunkyGameDemo code to test run your program.
Copy and paste the output of your program to a txt file and submit it with your
source code just like the machine problems. package FunkyGame;
public class FunkyGameDemo
public static void mainString args
TODO Autogenerated method stub
FunkyToken winner null;
FunkyBoard board new FunkyBoard;
FunkyToken tokens new FunkyToken;
tokens new RandomToken@;
tokens new MoveOneToken$;
tokens new RandomToken&;
board.placeTokentokens;
board.placeTokentokens;
board.placeTokentokens;
board.displayBoard;
do
for int i ; i tokens.length; i
if tokensiactive
tokensimoveboard;
System.out.printlntokensitoken "move";
board.displayBoard;
winner board.getWinner;
if winner null
break;
while winner null;
System.out.printlnwinnertoken won!";
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started