d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Easy Ruby Help
Add Reply New Topic New Poll
Member
Posts: 17,010
Joined: Mar 24 2009
Gold: 0.25
Jun 24 2013 08:38pm
Need some simple ruby homework help
Have to use simple loops to make a grid/field of asterisks around 10x20 as the output
Member
Posts: 33,701
Joined: Jul 17 2006
Gold: 1,990.00
Jun 24 2013 09:06pm
Quote (illidan432 @ Jun 24 2013 07:38pm)
Need some simple ruby homework help
Have to use simple loops to make a grid/field of asterisks around 10x20 as the output


are you asking someone to do it or do you want someone to look at your code

i mean im pretty sure its just going to be

Code
20.times do
10.times do
print "(asterisk and spacing you need)"
end
print new line (might be able to just use puts)
end


This post was edited by Kamikizzle on Jun 24 2013 09:08pm
Member
Posts: 17,010
Joined: Mar 24 2009
Gold: 0.25
Jun 24 2013 09:31pm
Quote (Kamikizzle @ Jun 24 2013 11:06pm)
are you asking someone to do it or do you want someone to look at your code

i mean im pretty sure its just going to be

Code
20.times do
10.times do
print "(asterisk and spacing you need)"
end
print new line (might be able to just use puts)
end


Oh k thanks
when you say spacing, what exact measurements would you put? sorry im bad at ruby
Member
Posts: 33,701
Joined: Jul 17 2006
Gold: 1,990.00
Jun 24 2013 11:42pm
Quote (illidan432 @ Jun 24 2013 08:31pm)
Oh k thanks
when you say spacing, what exact measurements would you put? sorry im bad at ruby


well idk it just depends on what you want the grid to look like. do you want just all asterisks or spaces in between eg

Code
****
****
****

or

* * * *
* * * *
* * * *


also donations appreciated

This post was edited by Kamikizzle on Jun 24 2013 11:43pm
Member
Posts: 17,010
Joined: Mar 24 2009
Gold: 0.25
Jun 25 2013 07:24am
Quote (Kamikizzle @ Jun 25 2013 01:42am)
well idk it just depends on what you want the grid to look like. do you want just all asterisks or spaces in between eg

Code
****
****
****

or

* * * *
* * * *
* * * *


also donations appreciated


all asterisks
Member
Posts: 33,701
Joined: Jul 17 2006
Gold: 1,990.00
Jun 25 2013 09:07am
Quote (illidan432 @ Jun 25 2013 06:24am)
all asterisks


hopefully you got it then but it should just be like 6 lines or so

10.times do
20.times do
print "*"
end
puts
end
Go Back To Homework Help Topic List
Add Reply New Topic New Poll