# A few questions before i start to programm

**URL:** <https://www.ruby-forum.com/t/a-few-questions-before-i-start-to-programm/189204>\
**Category:** Rails\
**Created:** [May 26, 2010, 7:17pm UTC](https://www.ruby-forum.com/t/a-few-questions-before-i-start-to-programm/189204 "2010-05-26T19:17:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![roelof](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@roelof](https://www.ruby-forum.com/u/roelof)\
**Post date:** [May 26, 2010, 7:17pm UTC](https://www.ruby-forum.com/t/a-few-questions-before-i-start-to-programm/189204/1 "2010-05-26T19:17:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![roelof](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@roelof](https://www.ruby-forum.com/u/roelof)\
**Post date:** [May 27, 2010, 10:59am UTC](https://www.ruby-forum.com/t/a-few-questions-before-i-start-to-programm/189204/2 "2010-05-27T10:59:53Z")

</div>

Hello,

Really nobody who wants to help ?

Roelof

---

<div class="post-metadata">

**Author:** ![roelof](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@roelof](https://www.ruby-forum.com/u/roelof)\
**Post date:** [May 27, 2010, 11:53am UTC](https://www.ruby-forum.com/t/a-few-questions-before-i-start-to-programm/189204/3 "2010-05-27T11:53:46Z")

</div>

On May 27, 9:33 am, roelof [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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](http://guides.rubyonrails.org)) before trying to find  
something more specific to what you’re trying to do.

Fred

---

<div class="post-metadata">

**Author:** ![roelof](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@roelof](https://www.ruby-forum.com/u/roelof)\
**Post date:** [May 27, 2010, 12:38pm UTC](https://www.ruby-forum.com/t/a-few-questions-before-i-start-to-programm/189204/4 "2010-05-27T12:38:51Z")

</div>

Actually, the goal is trivial.  
Check out [Getting Started with Rails — Ruby on Rails Guides](http://guides.rubyonrails.org/getting_started.html)

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

---

<div class="post-metadata">

**Author:** ![roelof](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@roelof](https://www.ruby-forum.com/u/roelof)\
**Post date:** [May 27, 2010, 1:40pm UTC](https://www.ruby-forum.com/t/a-few-questions-before-i-start-to-programm/189204/5 "2010-05-27T13:40:54Z")

</div>

Alex P wrote:

> Actually, the goal is trivial.  
> Check out [Getting Started with Rails — Ruby on Rails Guides](http://guides.rubyonrails.org/getting_started.html)
> 
> 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

---

<div class="post-metadata">

**Author:** ![roelof](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@roelof](https://www.ruby-forum.com/u/roelof)\
**Post date:** [May 27, 2010, 2:23pm UTC](https://www.ruby-forum.com/t/a-few-questions-before-i-start-to-programm/189204/6 "2010-05-27T14:23:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![roelof](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/258eb7/32.png) [@roelof](https://www.ruby-forum.com/u/roelof)\
**Post date:** [May 28, 2010, 9:26am UTC](https://www.ruby-forum.com/t/a-few-questions-before-i-start-to-programm/189204/7 "2010-05-28T09:26:58Z")

</div>

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 🙂

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