--Apple-Mail-3--413424260
Content-Type: text/plain;
	charset-ASCII;
	formatwed
Content-Transfer-Encoding: 7bit

A solution to a very old Ruby Quiz.  Just thought I would share.

James Edward Gray II

Begin forwarded message:

> From: Vento Sola <solavento / tut.by>
> Date: July 14, 2009 7:03:41 AM CDT
> To: submission / rubyquiz.com
> Subject: quiz LCD numbers
>
> Hi.
> It's my variant of the quiz "LCD numbers"
> With best regards, SolaVento.


--Apple-Mail-3--413424260
Content-Type: multipart/mixed;
	boundary 쭴


--Apple-Mail-4--413424260
Content-Type: text/html;
	charset-ASCII
Content-Transfer-Encoding: quoted-printable

<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">A solution to a very old Ruby Quiz. &nbsp;Just thought I would share.<div><br></div><div>James Edward Gray II<br><div><br><div>Begin forwarded message:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>From: </b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Vento Sola &lt;solavento / tut.by&gt;</font></div><divtyle="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>Date: </b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">July 14, 2009 7:03:41 AM CDT</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>To: </b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">submission / rubyquiz.com</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><b>Subject: </b></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><b>quiz LCD numbers</b></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div> </div><div>Hi.</div><div></div><div>It's my variant of the quiz "LCD numbers"<br></div><div></div><div>With best regards, SolaVento.</div> </blockquote></div></div></body></html>-Apple-Mail-4--413424260
Content-Disposition: attachment;
	filenameiz2_LCD.rb
Content-Type: text/x-ruby-script;
	x-unix-mode66;
	nameuiz2_LCD.rb"
Content-Transfer-Encoding: quoted-printable

#guiz 2 LCD number by SolaVento
Digits=[3,9,3,0,0,3,2,11,1,0,11,3,1,6,3,1,11,2,3,11,2,0,5,3,3,11,3,1,11,3]
tmp,output=[],[]
if $0 == __FILE__
    unless (ARGV.size == 1) or (ARGV.size == 3 and ARGV[0]=="-s")
        puts "Usage: #{File.basename($PROGRAM_NAME)} [-s SIZE] NUMBER"
xit
    end
    s, number = ARGV[0] != "-s" ? [1, ARGV[0]] : [ARGV[1].to_i, ARGV[2]]
    number.split(//).each {|x| tmp<<0<<Digits[x.to_i*3,3]}
    tmp.flatten.each do |m|
        str=Array.new(5,32)
        str[1],str[3]=32+92*m[0],32+92*m[1] if m<4
        str[0],str[2],str[4]=32+13*(m-4)[0],32+13*(m-4)[1],32+13*(m-4)[2] if m>4
        str[1],str[3]=[str[1]]*s,[str[3]]*s
        str.include?(45) ? s.times {output<<str.flatten} : output<<str.flatten
    end
    output.transpose.each {|str| str.each {|b| print b.chr}; puts}
end-Apple-Mail-4--413424260
Content-Type: text/html;
	charset-ASCII
Content-Transfer-Encoding: 7bit

<html><body styleord-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><blockquote type
ite"></blockquote></div><br></div></body></html> --Apple-Mail-4--413424260-- --Apple-Mail-3--413424260--