Jump to content

Need Help with a Program Design

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
8 replies to this topic

#1
bloodchains

bloodchains

    Learning Programmer

  • Members
  • PipPipPip
  • 73 posts
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.

Attached Files



#2
Natrobius

Natrobius

    Programmer

  • Members
  • PipPipPipPip
  • 166 posts
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.
The Natrobius
http://natrobius.info
CodeCall User

#3
bloodchains

bloodchains

    Learning Programmer

  • Members
  • PipPipPip
  • 73 posts
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
Natrobius

Natrobius

    Programmer

  • Members
  • PipPipPipPip
  • 166 posts
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.
The Natrobius
http://natrobius.info
CodeCall User

#5
bloodchains

bloodchains

    Learning Programmer

  • Members
  • PipPipPip
  • 73 posts
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
Natrobius

Natrobius

    Programmer

  • Members
  • PipPipPipPip
  • 166 posts
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.
The Natrobius
http://natrobius.info
CodeCall User

#7
bloodchains

bloodchains

    Learning Programmer

  • Members
  • PipPipPip
  • 73 posts
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
Natrobius

Natrobius

    Programmer

  • Members
  • PipPipPipPip
  • 166 posts
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?
The Natrobius
http://natrobius.info
CodeCall User

#9
bloodchains

bloodchains

    Learning Programmer

  • Members
  • PipPipPip
  • 73 posts
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...)