New Programmer - Where to start??

Associate
Joined
20 Mar 2018
Posts
3
Hi, I am new to programming currently learning Python and using Gamemaker studio.

I want to create a program for the World Cup that will be for a sweepstake.

I would like it to have a database of teams that can be allocated to people, the ability to virtually draw these teams out of a hat, the ability to eliminate teams as it goes on and some basic animation. Where the hell should I start???
 
Soldato
Joined
6 Mar 2008
Posts
10,078
Location
Stoke area
There are 32 teams in the world cup isn't there?

If you're simply just going to assign teams to a person I wouldn't bother with a database unless you plan on tracking a lot of other data.

Is this going to be done all at 1 time?

You'll need:

- list of the teams
- list of the people taking part
- blank dictionary

Next step is to start at TeamList[0] and the randomly select an entry of the people list. I'd then assign the team and the person to the dictionary and remove the team and person from the list.

Once complete, have the dictionary write to a simple notepad file so you can refer to it.

As for animation, it's not something I've touched but you may want to either complete each animation between each dictionary write or complete the dictionary write, save to text and then create the animation off the back of the completed dictionary.

We used to do something similar when I worked at the online Bingo company. The actual bingo game would be completed in the first second of the game starting but then the animation would carry on for up to 3 minutes after the game started so the people could follow it.
 
Associate
OP
Joined
20 Mar 2018
Posts
3
48 Teams this year I believe

So I can create a button that will pick a team from the dictionary but I am unsure how to get it to take out the team so it does not come up again. Also I will be assigning each team a flag so would this simply be a case of copying and pasting the code and assigning each team a jpeg from a folder? As you can probably tell I am very new to this!
 
Soldato
Joined
6 Mar 2008
Posts
10,078
Location
Stoke area
48 Teams this year I believe

So I can create a button that will pick a team from the dictionary but I am unsure how to get it to take out the team so it does not come up again. Also I will be assigning each team a flag so would this simply be a case of copying and pasting the code and assigning each team a jpeg from a folder? As you can probably tell I am very new to this!

There are several ways of removing items from a Python list. Remove will take the first matching entry out of the list, as all your teams are unique entries this would work for you. Here's a good overview of the options:
https://stackoverflow.com/questions/11520492/difference-between-del-remove-and-pop-on-lists

As for flags, are you talking about showing the matching country flags or random ones? I'd assume the matching country flag so you could have another dictionary called FLAGS that contains the country name and jpeg name. This will tell your program which once to choose. If you wanted random ones then yes, you could just have a list of jpgs. and create a seperate dictionary that matches the flag to the country at the same time as the person and the country but before the delete from the list.
 
Soldato
Joined
6 Mar 2008
Posts
10,078
Location
Stoke area
Thanks for the help :)

If you wanted to show ones that were still active or had been disqualified, it'd probably have a separate text file that listed all the teams and their current status in the tournament.

Does the world cup have tables before the knockout? If so you could show all this info a csv file, then it's just a case of parsing the text file each time you want to display it.

TeamName | Active | Group | Played | Won | Lost | Drawn | Points | Etc | Etc
 
Back
Top Bottom