JAVA PROGRAMMING HELP PLEASE!
hi!
FINALLY
so, my problem is this hare v tortoise race
right now im just starting, this is not anywhere near the final.
Okay whats the problem
heres the program, it never works...
What does it have to do
Here's the instructions
It's supposed to show the rabbit and turtle on different sides of a line and then they're supposed to move a little.
But it doesn't compile so it cant do that
type your code here
Okay pretty cool and simple
Make N number of arrays given the N number of players
Make them all object arrays
ASsign player classes
hare and tortoise, Use random command, let k be a number for the number of available moves for the player class type. generate a random int {1,2,3...K}
And you're done, all that's left is updating the objective array belonging to each player
make a move command, that "rolls the dice", and refreshes the position based on value of roll"
if {player}{placearray}{pos}>50, return {player},"winner" and end game
need to deal with some bounds though
Yea i know about the dice but how do i make this program work
if player{pos} <0, then play pos =0
i know @Dark_Riddles help
^java pro
yep
@Dark_Riddles HELP ME PLZ
Do you need it to be fixed or someone to complete it?....
fixed
I'll complete it later, but I just want to know why this isn't working and how to fix it
Alright, I'll have a look after im done eating my lunch, 15-30 mins or so
Ok thanks
I don't understand your code?
public void delay () { for (int i = 0; i<=90000000; i++ ); } { delay(); delay(); delay(); } { g.drawImage( Rabbit, 90, 20, 160, 100 , this ); g.drawImage( Turtle, 30, 200, 160, 100, this ); } } That's going to go in an infinite loop for eternity
That last part if the method is never reached. Its stuck in an infinity loop, above ^
OH.
Understand?
I understand, but how do I make the program wait a few seconds before making another turtle and rabbit?
HELP ME THE RABBIT NEEDS TO MOVE
hey are u good with java im kind of new to it and need some help and your like only person here
what u need kk ill help
oops i got it :D
@mathmale plz look at my message
Join our real-time social learning platform and learn together with your friends!