如何创建字母G& X与ROR代码? [英] How to create the letter G & X with ROR code?

查看:81
本文介绍了如何创建字母G& X与ROR代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用ROR更改以下代码以将字母G和X复制到命令提示符中?我在命令提示符下显示了字母H。



绘制顶部区域1

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





绘制中心栏区域2一直穿过酒吧

使用不同的角色或不同地区。





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





绘制底部区域3看起来像顶部栏



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

推荐答案

我已经完成了这封信的大部分内容,但我不确定我是否选择了正确的课程。难以在字母顶部后面创建空格。



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



#在'G'字母的顶部显示。



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 />


这篇关于如何创建字母G&amp; X与ROR代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆