1 Replies - 203 Views - Last Post: 09 October 2012 - 09:17 PM Rate Topic: -----

#1 kezzapwnz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 09-October 12

Creating a Table to organise results for my Sports Competition

Posted 09 October 2012 - 09:12 PM

Hey so pretty much, I am looking at creating a program using C which will enable me to keep track of our Universities Quidditch tournament. There will be 10 teams competing, with each team playing each other once.
What i want to do is:
1.Create a table which will keep track of the games-played/wins/losses/points for/points against (possibly a net points column too)
2.Have the table arrange in order after each match who has the most points (3 for a win, 1 for a draw)
3. If teams are level on points then have the table organise by 'points net' and then again alphabetically (im assuming i will use an if else statement to do this)
what i have worked out to do so far
I know that i need to define my variables including team names, games played, wins, loses, draws, points scored, points conceded.
*I have created 2 '.dat' files.
The first is simply a list of all the quidditch team names in alphabetical order. (will remain a constant)
The second is a list of mock game results presented in the form:* "Snitchgrabbers 170 BartyBeaters 140 (continuing like this as each game result is added)
Where i need help
I am stuck on a few things. Firstly how i go about importing both of these files (I am using Microsoft Visual Basic) Atm the best i can come up with is this code:
" int input_status;
FILE * fp;

fp = fopen("U:\\input1.dat","r");

if (fp==NULL)

printf("Unable to open the file");
" Furthermore, once i have these files imported i am not sure what loops i need to use to achieve what i want to achieve!*
I should mention i have basic knowledge in C coding and how loop constructs work.. I am a primary teacher so it isn't near the knowledge you guys have :)
I know that i am asking for a lot of help and i would be happy to make it up to anyone at all who is willing to spend some time to help me.. e.g. some months of reddit gold or a feature in our quidditch documentary which is being published... I will also give credit to you in the code for any help which is received.

Is This A Good Question/Topic? 0
  • +

Replies To: Creating a Table to organise results for my Sports Competition

#2 macosxnerd101  Icon User is online

  • Games, Graphs, and Auctions
  • member icon

Reputation: 11334
  • View blog
  • Posts: 42,748
  • Joined: 27-December 08

Re: Creating a Table to organise results for my Sports Competition

Posted 09 October 2012 - 09:17 PM

Please avoid duplicate posting.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1