aliyah8585
Badges: 2
Rep:
?
#1
Report Thread starter 1 year ago
#1
i need to code a top trump game where the player is playing against the computer not sure how to start?
0
reply
lokidokie
Badges: 12
Rep:
?
#2
Report 1 year ago
#2
What computer language are you planning to use?
0
reply
aliyah8585
Badges: 2
Rep:
?
#3
Report Thread starter 1 year ago
#3
(Original post by lokidokie)
What computer language are you planning to use?
python
0
reply
winterscoming
Badges: 19
Rep:
?
#4
Report 1 year ago
#4
Firstly, do you know the rules of the game well enough to be able to describe them in clear and explicit detail on paper? Could you explain step-by-step how the game works and its rules, such as win/loss conditions, how the different cards are scored, etc?

The prerequisite for being able to code anything is to have a complete, thorough understanding of the thing that you're trying to code down to the smallest details.

A good way to get your head around this would be to start drawing out some ideas on paper and create a list of the things that you want your program to be able to do. If you do a Google search, you ought to be able to find websites which have a good breakdown of the rules, and maybe even other peoples' attempts to do something similar which you could use for inspiration.

Always consider the way a user is going to interact with your program - i.e. the data / screens they will see, and the data they will type in to the program, as well as the steps they'll take to interact with it. It often helps to draw some mock-up diagrams/pictures of how it'll look. This is helpful because it will inform the data structures you need in your program - in general, the ease or difficulty of writing your program can be heavily influenced the way you structure your data, and the kinds of data you choose to represent things from your game (For example, consider how you'll represent the Suit and Rank of your cards, and how you'll represent a deck or the cards in a player's hand).

Lastly, don't try to solve everything at once. Writing a program involves divide-and-conquer. When a problem seems too big, break it down into something small and managable which you can easily write on its own - for example, if part of your program needs to do anything with a list of cards, you might create a function or section of a UI which is simply able to display cards (or their representation) on a screen, or you may start with a simple check for a win/loss condition for a game. It tends to be much easier to tackle tiny pieces of the problem than to try solving everything at once..
0
reply
lokidokie
Badges: 12
Rep:
?
#5
Report 1 year ago
#5
(Original post by aliyah8585)
python
Before you start: plan the program. Use a flowchart or something along the lines of that.
0
reply
Bulletzone
Badges: 22
Rep:
?
#6
Report 1 year ago
#6
That's very wow.....I know how I'd go about it tbh but first,

Are you good with Classes and Functions?
Will this be using Images? (If so I'm useless)
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • Bournemouth University
    Midwifery Open Day at Portsmouth Campus Undergraduate
    Wed, 16 Oct '19
  • Teesside University
    All faculties open Undergraduate
    Wed, 16 Oct '19
  • University of the Arts London
    London College of Fashion – Cordwainers Footwear and Bags & Accessories Undergraduate
    Wed, 16 Oct '19

How has the start of this academic year been for you?

Loving it - gonna be a great year (131)
17.99%
It's just nice to be back! (197)
27.06%
Not great so far... (263)
36.13%
I want to drop out! (137)
18.82%

Watched Threads

View All