Need Help with a Program Design
Started by bloodchains, Nov 05 2009 04:04 PM
8 replies to this topic
#1
Posted 05 November 2009 - 04:04 PM
So my professor wants us to do this quiz about a simple game he made. He wants us to figure out how it works and what the logic of the programming in this game is. Can anybody help me? I kinda figured out what objects to use, but honestly, I'm at a loss. Please see the attachment on this thread.
|
|
|
#2
Posted 05 November 2009 - 04:40 PM
We don't do homework here. Have you programmed before? What about it is baffling you? A specific question about part of it would be best, but you still should figure it out yourself, and gain invaluable skill while you're at it.
#3
Posted 05 November 2009 - 08:17 PM
Well, I've done what I can so far with it. If it's not too much to ask, then I'll attach my current work and maybe someone can take a look at it and just say if it makes sense at all, although it's still not finished yet. Otherwise, then I'll just submit it as an unfinished work and I'll just see the answer once the professor's done checking the students' works. I'm pretty sure he'll go through the problem, but it'll be too late by then.
#4
Posted 05 November 2009 - 08:34 PM
Nathan’s Suggestions:
Program Logic
1. User presses start
2. Game choses random player
3. Player throws three coins
4. Random number of coins are heads
5. Will heads coins + score > 10? Yes–Goto 8. No-Goto 6.
6. Number of heads coins is added to score
7. Next user throws three coins.
8. Goto 4
LOL... Maybe this will help.
Program Logic
1. User presses start
2. Game choses random player
3. Player throws three coins
4. Random number of coins are heads
5. Will heads coins + score > 10? Yes–Goto 8. No-Goto 6.
6. Number of heads coins is added to score
7. Next user throws three coins.
8. Goto 4
LOL... Maybe this will help.
#5
Posted 05 November 2009 - 08:43 PM
Hmm, yes, I think you just added something to the ones I've already come up with. #5 is confusing though. It looks like there's an endless loop there. Oh well, I'll just figure it out. I still have until tomorrow before midnight to do this anyway.
#6
Posted 06 November 2009 - 10:25 AM
Yes, I should have sent >10 to a line stating select next player, then loop. It's not a finished product, just something to look at. That's what I gathered from your assignment however, as being the kind of thing your professor is expecting.
#7
Posted 06 November 2009 - 12:00 PM
Oh I see. And I'm wondering why at line 5, if it's yes, it goes to line 8, which goes to line 4. You could just go straight to line 4 if it's yes, but it doesn't matter.
#8
Posted 06 November 2009 - 08:16 PM
The rules you had typed said that if the added score was greater than 10, it discarded it and skipped to the next player right?
#9
Posted 06 November 2009 - 08:38 PM
Yes, although I did something more specific. Say, if the player has 8 or 9 points and the coins come up with 3 heads, then the game just moves to the next player, and if a player has 9 points and the coins come up with 2 heads, then the game moves to the next player. I already submitted the answers to my professor, so I hope I did it right.
(How come my avatar isn't showing up...)
(How come my avatar isn't showing up...)


Sign In
Create Account



Back to top









