Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can you alter the following code to replicate the letters 'G' and 'X' into your command prompt using ROR? I've made the letter 'H' displaying in the command prompt.

Draw top Region 1
for y in 1..8<br />
      for x in 1..6<br />
        print "*"<br />
      end<br />
    <br />
      for x in 1..8<br />
        print " "<br />
      end<br />
    <br />
      for x in 1..6<br />
        print "p"<br />
      end<br />
    	<br />
      print "\n"<br />
    end


Draw center bar Region 2 goes all the way across the bar
Use a different character or different regions.

for y in 1..3<br />
      for x in 1..20<br />
        print "*"<br />
      end<br />
      print "\n"<br />
    end


Draw bottom bar Region 3 Look like the top bar
for y in 1..8<br />
      for x in 1..6<br />
        print "*"<br />
      end<br />
    <br />
      for x in 1..8<br />
        print " "<br />
      end<br />
    <br />
      for x in 1..6<br />
        print "*"<br />
      end<br />
    	<br />
      print "\n"<br />
    end
Posted

1 solution

I've gotten the top part of the letter done but I'm not sure if I'm on the right course. What is difficult is creating the spaces following the top part of the letter.

http://tinypic.com/r/2qurbdx/8[^]

#Draw top bar across the the letter 'G'.

for x in 1..3<br />
	for y in 1..30<br />
		print "*"<br />
	end<br />
	print "\n"<br />
end <br />
<br />
for y in 1..6<br />
	print "*"<br />
end <br />
	print "\n"<br />
	<br />
for y in 1..6<br />
		print "*"<br />
end 	<br />
	print "\n"<br />
<br />
for y in 1..6<br />
	print "*"<br />
end <br />
	print "\n"<br />
<br />
for y in 1..6<br />
	print "*"<br />
end <br />
		print "\n"<br />
<br />
for y in 1..6<br />
	print "*"<br />
end <br />
		print "\n"<br />
<br />
for y in 1..6	<br />
	print "*"<br />
end <br />
		print "\n"<br />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900