Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [QUIZ] LCD Numbers (#14)

Reply
Thread Tools

[QUIZ] LCD Numbers (#14)

 
 
Ruby Quiz
Guest
Posts: n/a
 
      01-07-2005
The three rules of Ruby Quiz:

1. Please do not post any solutions or spoiler discussion for this quiz until
48 hours have passed from the time on this message.

2. Support Ruby Quiz by submitting ideas as often as you can:

http://www.grayproductions.net/ruby_quiz/

3. Enjoy!

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

This week's quiz is to write a program that displays LCD style numbers at
adjustable sizes.

The digits to be displayed will be passed as an argument to the program. Size
should be controlled with the command-line option -s follow up by a positive
integer. The default value for -s is 2.

For example, if your program is called with:

> lcd.rb 012345


The correct display is:

-- -- -- --
| | | | | | | |
| | | | | | | |
-- -- -- --
| | | | | | |
| | | | | | |
-- -- -- --

And for:

> lcd.rb -s 1 6789


Your program should print:

- - - -
| | | | | |
- - -
| | | | | |
- - -

Note the single column of space between digits in both examples. For other
values of -s, simply lengthen the - and | bars.


 
Reply With Quote
 
 
 
 
Robert McGovern
Guest
Posts: n/a
 
      01-07-2005
Question, I assume the idea is for a 7 seqment LCD?

Also just wanted to say that the formatting on the quiz page

http://www.grayproductions.net/ruby_quiz/quiz14.html

is broken for the examples.


 
Reply With Quote
 
 
 
 
Robert McGovern
Guest
Posts: n/a
 
      01-07-2005
> Also just wanted to say that the formatting on the quiz page
>
> http://www.grayproductions.net/ruby_quiz/quiz14.html
>
> is broken for the examples.


In Internet Explorer 6 but fine in Firefox 1.0


 
Reply With Quote
 
James Edward Gray II
Guest
Posts: n/a
 
      01-07-2005
On Jan 7, 2005, at 8:57 AM, Robert McGovern wrote:

> Question, I assume the idea is for a 7 seqment LCD?


When -s == 1, yes.

James Edward Gray II



 
Reply With Quote
 
James Edward Gray II
Guest
Posts: n/a
 
      01-07-2005
On Jan 7, 2005, at 9:02 AM, Robert McGovern wrote:

>> Also just wanted to say that the formatting on the quiz page
>>
>> http://www.grayproductions.net/ruby_quiz/quiz14.html
>>
>> is broken for the examples.

>
> In Internet Explorer 6 but fine in Firefox 1.0


I'm unhappy with the current Ruby Quiz Web site and intend to replace
it as soon as I can find the time. Because of that, I'm not spending
too much time fiddling with the CSS myself, but I'll accept a working
patch if you're up to bug hunting.

I hope I don't sound uncaring. I'm not. I do want Ruby Quiz to have a
great site, but the current version has some built-in weaknesses I want
to get past, so I would rather spend my time replacing it.

I do thank you for the information.

James Edward Gray II



 
Reply With Quote
 
Douglas Livingstone
Guest
Posts: n/a
 
      01-07-2005
> but I'll accept a working
> patch if you're up to bug hunting.


Replace

<p class="example">

with

<pre class="example">

and update the corresponding </p>s to </pre>

The examples are prefromatted text, so mark them up that way and you
make life easier for yourself You'll probably want to remove the
"white-space: pre" bits too.

Douglas

On Sat, 8 Jan 2005 00:42:19 +0900, James Edward Gray II
<(E-Mail Removed)> wrote:
> On Jan 7, 2005, at 9:02 AM, Robert McGovern wrote:
>
> >> Also just wanted to say that the formatting on the quiz page
> >>
> >> http://www.grayproductions.net/ruby_quiz/quiz14.html
> >>
> >> is broken for the examples.

> >
> > In Internet Explorer 6 but fine in Firefox 1.0

>
> I'm unhappy with the current Ruby Quiz Web site and intend to replace
> it as soon as I can find the time. Because of that, I'm not spending
> too much time fiddling with the CSS myself, but I'll accept a working
> patch if you're up to bug hunting.
>
> I hope I don't sound uncaring. I'm not. I do want Ruby Quiz to have a
> great site, but the current version has some built-in weaknesses I want
> to get past, so I would rather spend my time replacing it.
>
> I do thank you for the information.
>
> James Edward Gray II
>
>



 
Reply With Quote
 
James Edward Gray II
Guest
Posts: n/a
 
      01-07-2005
On Jan 7, 2005, at 10:12 AM, Douglas Livingstone wrote:

>> but I'll accept a working
>> patch if you're up to bug hunting.

>
> Replace
>
> <p class="example">
>
> with
>
> <pre class="example">
>
> and update the corresponding </p>s to </pre>
>
> The examples are prefromatted text, so mark them up that way and you
> make life easier for yourself You'll probably want to remove the
> "white-space: pre" bits too.


This is a hold-over of the original site design when I didn't use
pre-formatted whitespace for the examples. (Yes, that was dumb.)

The change you purpose requires me to correct every quiz page. <br />s
will need to be translated to \ns as well.

Also, this change is incompatible with the Ruby code blocks, which are
probably suffering from the same problems. (I assume.)

I should have said "a working CSS patch", because if it's not that
simple it's a waste of time on a doomed site.

These, and other reasons, are why I'm planning a replacement.

James Edward Gray II



 
Reply With Quote
 
Douglas Livingstone
Guest
Posts: n/a
 
      01-07-2005
> I should have said "a working CSS patch", because if it's not that
> simple it's a waste of time on a doomed site.


True, you did say that.

As you have a doctype in there already, you could get off with putting this:

_white-space: pre;

After the following line:

white-space: pre-wrap; /* avoid overflow */

(The underscore at the start will make it apply only in IE, leaving
other browsers to display as they do already.)

Douglas


 
Reply With Quote
 
James Edward Gray II
Guest
Posts: n/a
 
      01-07-2005
On Jan 7, 2005, at 1:09 PM, Douglas Livingstone wrote:

>> I should have said "a working CSS patch", because if it's not that
>> simple it's a waste of time on a doomed site.

>
> True, you did say that.
>
> As you have a doctype in there already, you could get off with putting
> this:
>
> _white-space: pre;
>
> After the following line:
>
> white-space: pre-wrap; /* avoid overflow */
>
> (The underscore at the start will make it apply only in IE, leaving
> other browsers to display as they do already.)


I dropped this in and saw no change in any of my browsers, just as you
said. I've updated the site with the change. Does this fix the
examples in IE 6?

Thanks for the tips.

James Edward Gray II



 
Reply With Quote
 
Zach Dennis
Guest
Posts: n/a
 
      01-07-2005
This quiz got my attention. I can't wait until I get home from work and
can do this one...this one just looks so fun

=)

Zach


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLUTION] Ruby Quiz #14 LCD Numbers email55555 email55555 Ruby 8 01-10-2005 11:14 PM
Canon powershot S1 LCD Vs Kodak DX6490 LCD?? Jason Digital Photography 3 06-07-2004 07:38 PM
Plastic cover for 2.5 inch LCD [like the cover comes to protect LCD of some DSLR] zxcvar Digital Photography 0 12-28-2003 03:52 PM
LCD monitor with TV Tuner or LCD TV with PC input? John Computer Information 0 12-18-2003 10:32 PM



Advertisments