```Hi Troy,

The code you showed in the previous e-mail is different.

> fourth array
> my_array = [¡È3¡É, ¡È-¡È, ¡ÈX¡È, ¡ÈX¡È, ¡ÈX¡È]

With this initialization you're getting cols and lines swapped
compared to the previous example.

> @board    = Array.new(6, Array.new(7, "-¡È))

Keep in mind that with this initialization above you will transverse
the array like this.

@board[line][column]

For something like this:
1 2 3 4 5 6 7
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - x - - - -

@board[0] # for example
# => ["1", "2", "3", "4", "5", "6", "7"]

@board[6]
# => [ "-", "-", "x", "-", "-", "-", "-" ]

@board[6][2] # line 6, col 2
# => "x"

@board[6][1] # line 6, col 1
# => "-"

# Not like the 'my_array' example
my_array = [¡È3¡É, ¡È-¡È, ¡ÈX¡È, ¡ÈX¡È, ¡ÈX¡È]

Where the Array has one column.

So, you're probably willing to loop in reverse from the last _line_
(6) to the second one (1) (because the first line (0) is the header).
While looping, testing the desired column (that column chosen by the
user), for example column 2 (the third one) to see if it has an "x".
If not, you should change it to an "x" and break the loop.
It yes, it has an "x", you should try to loop again, testing the line
before the current line (line-1) and go until line 1 (the second line;

Is it something like "Conect Four" ? (http://en.wikipedia.org/wiki/Connect_Four)

It's not hard and I think you're getting closer.
If you get stuck and need more help just drop another e-mail on this thread.

Abinoam Jr.

On Sat, Dec 20, 2014 at 12:36 AM, Troy Leach <troyleach29 / gmail.com> wrote:
> Ok..if I under stand here is snippets of the full array (sorry I haven¡Çt
> loaded this up to git or I could show all my code but it¡Çs a bit of a mess
> right now)
>
> this is my array
>
> @board    = Array.new(6, Array.new(7, "-¡È))
>
>
> => produces
> 1 2 3 4 5 6 7
> - - - - - - -
> - - - - - - -
> - - - - - - -
> - - - - - - -
> - - - - - - -
> - - - - - - -
>
> => select a column to drop a game piece
> => user input == 3
>
> after the user input the new board would look like this
>
> 1 2 3 4 5 6 7
> - - - - - - -
> - - - - - - -
> - - - - - - -
> - - - - - - -
> - - - - - - -
> - - x - - - -
>
> is this better?
>
> On Dec 19, 2014, at 9:29 PM, Jorge Colon <2upmedia / gmail.com> wrote:
>
> Hi Troy,
>
> Could you add how you'd expect the array to look like and how you would not?
> Perhaps throw in some different scenarios if that applies?
>
> Regards,
>
> Jorge Colon
> Senior Software Architect/Owner
> 2UP Media
>
> Zend Certified Engineer
> www.bit.ly/jorgecolonzce
>
> Sent from my mobile device
>
> On Dec 19, 2014, at 10:27 PM, Troy Leach <troyleach29 / gmail.com> wrote:
>
> sorry to be vague...
> I tried what you suggested. It didn¡Çt work for me.
>
> starting array
> my_array = [¡È3¡É, ¡È-¡È, ¡È-¡È, ¡È-¡È, ¡È-¡È]
>
> second array
>
> my_array = [¡È3¡É, ¡È-¡È, ¡È-¡È, ¡È-¡È, ¡ÈX¡È]
>
> third array
> my_array = [¡È3¡É, ¡È-¡È, ¡È-¡È, ¡ÈX¡È, ¡ÈX¡È]
>
> fourth array
> my_array = [¡È3¡É, ¡È-¡È, ¡ÈX¡È, ¡ÈX¡È, ¡ÈX¡È]
>
> what i¡Çm trying to do is basically make a game. I want the user to pick
> ¡Ærow¡Ç  3 to put a game piece in so I need to see if the game piece already
> exist or not. if it doesn¡Çt insert a game piece if it does check the next
> empty spot to see if the game piece exist there if it doesn¡Çt insert a game
> piece if it does move onto the next and so on¡Ä make sense..
>
> I really want to try and write the code myself but I have been struggling
> with this one piece for two days¡Ä make sense?
>
>
>
> On Dec 19, 2014, at 9:17 PM, Raj Sahae <rajsahae / gmail.com> wrote:
>
> The question is a bit vague. Are you just trying to iterate through the
> array in reverse? Can you give an example input and output?
>
> I was originally going to just say something like
>
> my_array.reverse.map{|n| n == ¡Æ-¡Æ ? ¡ÆX¡Ç : n}.reverse
>
> It¡Çs not the most efficient way, it would be better to just iterate from
> behind once, but does that do what you want or are you looking for different
> output?
>
> ¡½
> Sent from Mailbox
>
>
> On Fri, Dec 19, 2014 at 7:07 PM, Troy Leach <troyleach29 / gmail.com> wrote:
>>
>> Hello all,
>> first time posting, or emailing as it may be.
>> I¡Çm a newbie to Ruby and I am struggling with something that seems very
>> very simple to me but no matter what I try it I can¡Çt get my desired out
>> put. (therefore I guess it isn¡Çt easy¡Ä.)
>>
>> I want to iterate through my_array to see if the last element is == ¡È-¡È if
>> it is replace that element with ¡ÈX¡É
>>
>> Then I want to repeat this operation.
>> I want to iterate through my_array to see if the last element is == to ¡È-¡È
>> NO
>> move to the next to last element, is this element == to ¡È-¡È YES replace
>> with ¡ÈX"
>>
>> I know how to make them ALL change at once but that isn¡Çt my goal, it
>> needs to be one at time. Example would be receiving user input so I would
>> want to change the elements one at a time. Kind of like a match data.
>>
>> starting array
>> my_array = [¡È3¡É, ¡È-¡È, ¡È-¡È, ¡È-¡È, ¡È-¡È]
>>
>> Hope this makes sense and thanks in advance for any help!
>>
>> Troy
>>
>>
>
>
>
```