A few questions before i start to programm

Hello,

I want to learn ruby. As a learning experience I want to write a programm which people can put the results of games in a tournament. The programm produces which team is first and so on.

My question is :

1) Are there any tutorials about making a menu and working space ? 2) Are there any tutorial about how i can check if a team has already played a game. 3) Are there any totorials about how I can sort the teams on multiple things ?

Roelof

Hello,

Really nobody who wants to help ?

Roelof

Actually, the goal is trivial. Check out Getting Started with Rails — Ruby on Rails Guides

Install ruby, gem, rails, and start developing, ask questions as you go along. There's no such thing as tutorial for a menu or working space. Checking whether a team has already played the game is a matter of your model. For instance, you have a model called Team, which has a boolean field called played_game. So, you just get teams via Team.find, and include your condition, or just use team.played_game and check whether it's true or no.

Good luck

Hello,

Really nobody who wants to help ?

I think you questions are a mixture of over vague and over specific, for example i don't think you'll ever find a tutorial for your second question as that's quite a narrow question that depends quite tightly on how you'll decide to store the team & tournament data. Your first question on the other hand is very vague. I think you should probably be looking for some basic active record tutorials (perhaps read some of the guides at guides.rubyonrails.org) before trying to find something more specific to what you're trying to do.

Fred

Alex P wrote:

Actually, the goal is trivial. Check out Getting Started with Rails — Ruby on Rails Guides

Install ruby, gem, rails, and start developing, ask questions as you go along. There's no such thing as tutorial for a menu or working space. Checking whether a team has already played the game is a matter of your model. For instance, you have a model called Team, which has a boolean field called played_game. So, you just get teams via Team.find, and include your condition, or just use team.played_game and check whether it's true or no.

Good luck

Hello,

Thank you. I will read the gettting_started tutorial.

I like the idea of you. One question. How do I set the boolean field.

My idea was to make a database of all the played games. Then read that database one or one if the user choose for making the rankings.

I have he idea I have to read a lot to make this idea work.

Roelof

Hello,

To make it more clear.

What I have in mind is this:

Make a application with a menu which contains a input choice and a rankings choice.

If the user chooses for input the user gets a form so the data can be in the database.

If the user chooses for rankings the followrig occurs.

Every rule in the database is be read. Then there is a check if the team has already played a game.

If so, then the data will changed . If not, team is added to a array and the data willbe changed.

After that the data will be sorted so the best team is displayed first and so on.

Database will look like this :

Home team Away team Score home team Score away team.

Array looks like this :

Team Played games game points points made by that team points the other teams made in games with this team. example team A played 3 games, won 2 , made 50 , other teams made 20 team : A game points 2*3=6 points : 50 points : 20

I hope it's now clear what i have in mind.

Roelof

Well, it's all quite simple. Create a model script/generate model team played_game:boolean name:string and it will generate model and migration for you :slight_smile:

Just get trough the tutorial. I guarantee, you'll find all the answers. For your particular application it will work 100%