[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [QUIZ] Matrix Rotator (#209

brabuhr

6/12/2009 6:06:00 PM

2009/6/12 Daniel Moore <yahivin@gmail.com>:
> I have attached the following test suite for your convenience:
> =A0 =A0 =A0 =A0assert_equal Matrix.rotate(square), square_rotated
> =A0 =A0 =A0 =A0assert_equal Matrix.rotate(rectangle), rectangle_rotated

Shouldn't that be?:

assert_equal square_rotated, Matrix.rotate(square)
assert_equal rectangle_rotated, Matrix.rotate(rectangle)

:-)

5 Answers

Daniel Moore

6/12/2009 6:35:00 PM

0

On Fri, Jun 12, 2009 at 11:06 AM, <brabuhr@gmail.com> wrote:
> 2009/6/12 Daniel Moore <yahivin@gmail.com>:
>> I have attached the following test suite for your convenience:
>> =A0 =A0 =A0 =A0assert_equal Matrix.rotate(square), square_rotated
>> =A0 =A0 =A0 =A0assert_equal Matrix.rotate(rectangle), rectangle_rotated
>
> Shouldn't that be?:
>
> assert_equal square_rotated, Matrix.rotate(square)
> assert_equal rectangle_rotated, Matrix.rotate(rectangle)
>
> :-)
>

That's what I thought at first, and how I originally had it, but the
docs on TestUnit specify:

assert_equal(expected, actual, message=3Dnil)

In this situation square_rotated is the expected result and
Matrix.rotate(square) is the actual result that the quiz solution
generates.

Thanks for bringing this up, each testing framework has its own order
conventions as well, I know QUnit has actual first and expected
second.

Have fun on the quiz!

--=20
-Daniel
http:/...

Daniel Moore

6/12/2009 11:29:00 PM

0

On Fri, Jun 12, 2009 at 4:03 PM, Robert Dober<robert.dober@gmail.com> wrote=
:
> On Fri, Jun 12, 2009 at 8:34 PM, Daniel Moore<yahivin@gmail.com> wrote:
>> On Fri, Jun 12, 2009 at 11:06 AM, <brabuhr@gmail.com> wrote:
>>> 2009/6/12 Daniel Moore <yahivin@gmail.com>:
>>>> I have attached the following test suite for your convenience:
>>>> =A0 =A0 =A0 =A0assert_equal Matrix.rotate(square), square_rotated
>>>> =A0 =A0 =A0 =A0assert_equal Matrix.rotate(rectangle), rectangle_rotate=
d
>>>
>>> Shouldn't that be?:
>>>
>>> assert_equal square_rotated, Matrix.rotate(square)
>>> assert_equal rectangle_rotated, Matrix.rotate(rectangle)
>>>
>>> :-)
>>>
>>
>> The docs on TestUnit specify:
>>
>> =A0 =A0assert_equal(expected, actual, message=3Dnil)
>>
> Wait a second, maybe I am completely confused, but that is exactly
> what brabuhr said no?,...
> But as all my tests pass it does not matter ;).
>
> This somehow coincides with the specs I have attached, with Daniel's
> kind permission. It is interesting to
> notice how each of the three test tools avoids that kind of confusion
> in three different ways.
>
> Cheers
> Robert
>

Brahbur and Robert are right on the order of the test arguments, my mistake=

His Highness the TibetanMonkey, aka Comandante Banana

4/21/2011 2:30:00 AM

0

On Apr 20, 8:31 pm, "SFD" <s...@127000.00> wrote:
> "Cormac" <cormac.brada...@gmail.com> wrote in message
>
> news:eb3b5f3c-3d42-4bf3-9d2d-f2d5c801aa84@u15g2000vby.googlegroups.com...
> On Apr 19, 1:22 pm, "His Highness the TibetanMonkey, the Beach Cruiser
>
>
>
> Philosopher" <comandante.ban...@yahoo.com> wrote:
> > Satan got the bad reputation but it's God that throughout the Bible
> > approves or engages in all kinds of wars, revenge, rape, decapitation,
> > incest and terrorism, including the destruction of the Babel Tower
> > which sounds to me like the attack on the Twin Towers.
>
> > So what has the Devil done besides tempting Adam & Eve with the fruit
> > from the Tree of Knowledge? Satan got some bad press by the
> > Christians, it seems.
>
> > ----------------------------------------------
>
> >http://webspawner.com/users/BANANA...
> >There is no obvious connection between Satan and the serpent in the
> >Genesis myth. Satan appears to have been invented by the early
> >Christian scribes bases on the god Pan.
> >Cormac.
>
> Likewise, there is no connection between Satan, God(s) and reality.
> It is possible of course, that Pan was real, in that Pan was an alien.
>
> Humans on this planet originated from aliens having intercourse with
> earthly 'creatures'. Aliens from different galaxies have different
> appearances,
> that's why we have different looking humans on the planet - Westerners,
> Chinese, Mongolian, African etc. etc. etc...
>
> These aliens came here, gave the local females a 'shot' wherever they
> landed,
> raided the land of all the 'Good Grass' , jumped back in their spacemobiles
> and buggered off!
>
> The primitive male creatures scribed as best they could images of what
> they saw, these images have manifested in mans imagination over time
> to become what we now call Gods. The primary purpose of these Gods is
> to keep as many bums on seats as possible to support an industry based on
> myth.
>
> The above theory CANNOT be proven nor disproven, therefore it is just
> as valid as any of the so called 'Main Line Religions' about today.
>
> Based on the above, I am thinking of building a church/religion, all I
> need is a good catchy name and slogan for it. Any ideas?
>
> Of course there will be a non refundable joining fee, forced monthly
> donations, annual membership subscriptions, extra blessings for those
> that make donations. The blessings will be a guaranteed never ending ride in
> a spacemobile when you fall off your perch.
>
> I will have to get some weird looking robes to play the part of the scary
> one.
> A complete infrustructure will be put in place to accomodate the many
> 'teachers' that we will have. Every teacher will be armed with a bong and
> enough grass to blow away even the strongest of disbelievers minds!
>
> All contributions for a startup fund can be emailed to me via this NG -
> thanks.
> I will personally ensure every cent is well spent.

It sounds good to me. Hey, we already got the Bad Guy...

http://www.seattlemet.com/assets/0001/3695/satan.jpg?...

Aliens should scare them even further.

SFD

4/21/2011 5:47:00 AM

0


"His Highness the TibetanMonkey, the Beach Cruiser Philosopher"
<comandante.banana@yahoo.com> wrote in message
news:d2e16c0f-b4c0-4920-94f6-304280807e87@a21g2000prj.googlegroups.com...
On Apr 20, 8:31 pm, "SFD" <s...@127000.00> wrote:
> "Cormac" <cormac.brada...@gmail.com> wrote in message
>
> news:eb3b5f3c-3d42-4bf3-9d2d-f2d5c801aa84@u15g2000vby.googlegroups.com...
> On Apr 19, 1:22 pm, "His Highness the TibetanMonkey, the Beach Cruiser
>
>
>
> Philosopher" <comandante.ban...@yahoo.com> wrote:
> > Satan got the bad reputation but it's God that throughout the Bible
> > approves or engages in all kinds of wars, revenge, rape, decapitation,
> > incest and terrorism, including the destruction of the Babel Tower
> > which sounds to me like the attack on the Twin Towers.
>
> > So what has the Devil done besides tempting Adam & Eve with the fruit
> > from the Tree of Knowledge? Satan got some bad press by the
> > Christians, it seems.
>
> > ----------------------------------------------
>
> >http://webspawner.com/users/BANANA...
> >There is no obvious connection between Satan and the serpent in the
> >Genesis myth. Satan appears to have been invented by the early
> >Christian scribes bases on the god Pan.
> >Cormac.
>
> Likewise, there is no connection between Satan, God(s) and reality.
> It is possible of course, that Pan was real, in that Pan was an alien.
>
> Humans on this planet originated from aliens having intercourse with
> earthly 'creatures'. Aliens from different galaxies have different
> appearances,
> that's why we have different looking humans on the planet - Westerners,
> Chinese, Mongolian, African etc. etc. etc...
>
> These aliens came here, gave the local females a 'shot' wherever they
> landed,
> raided the land of all the 'Good Grass' , jumped back in their
> spacemobiles
> and buggered off!
>
> The primitive male creatures scribed as best they could images of what
> they saw, these images have manifested in mans imagination over time
> to become what we now call Gods. The primary purpose of these Gods is
> to keep as many bums on seats as possible to support an industry based on
> myth.
>
> The above theory CANNOT be proven nor disproven, therefore it is just
> as valid as any of the so called 'Main Line Religions' about today.
>
> Based on the above, I am thinking of building a church/religion, all I
> need is a good catchy name and slogan for it. Any ideas?
>
> Of course there will be a non refundable joining fee, forced monthly
> donations, annual membership subscriptions, extra blessings for those
> that make donations. The blessings will be a guaranteed never ending ride
> in
> a spacemobile when you fall off your perch.
>
> I will have to get some weird looking robes to play the part of the scary
> one.
> A complete infrustructure will be put in place to accomodate the many
> 'teachers' that we will have. Every teacher will be armed with a bong and
> enough grass to blow away even the strongest of disbelievers minds!
>
> All contributions for a startup fund can be emailed to me via this NG -
> thanks.
> I will personally ensure every cent is well spent.

>It sounds good to me. Hey, we already got the Bad Guy...

>http://www.seattlemet.com/assets/0001/3695/satan.jpg?...

>Aliens should scare them even further.

Looks like a reasonable type of chap to me! Its the 'other' fellow,
the Magical one, we need to be concerned about, making it so that little
children have to eat all that chocolate this time of year - huh!
Yet again, another money spinner.


His Highness the TibetanMonkey, aka Comandante Banana

4/21/2011 12:29:00 PM

0

On Apr 21, 1:47 am, "SFD" <s...@127000.00> wrote:
> "His Highness the TibetanMonkey, the Beach Cruiser Philosopher"<comandante.ban...@yahoo.com> wrote in message
>
> news:d2e16c0f-b4c0-4920-94f6-304280807e87@a21g2000prj.googlegroups.com...
> On Apr 20, 8:31 pm, "SFD" <s...@127000.00> wrote:
>
>
>
> > "Cormac" <cormac.brada...@gmail.com> wrote in message
>
> >news:eb3b5f3c-3d42-4bf3-9d2d-f2d5c801aa84@u15g2000vby.googlegroups.com...
> > On Apr 19, 1:22 pm, "His Highness the TibetanMonkey, the Beach Cruiser
>
> > Philosopher" <comandante.ban...@yahoo.com> wrote:
> > > Satan got the bad reputation but it's God that throughout the Bible
> > > approves or engages in all kinds of wars, revenge, rape, decapitation,
> > > incest and terrorism, including the destruction of the Babel Tower
> > > which sounds to me like the attack on the Twin Towers.
>
> > > So what has the Devil done besides tempting Adam & Eve with the fruit
> > > from the Tree of Knowledge? Satan got some bad press by the
> > > Christians, it seems.
>
> > > ----------------------------------------------
>
> > >http://webspawner.com/users/BANANA...
> > >There is no obvious connection between Satan and the serpent in the
> > >Genesis myth. Satan appears to have been invented by the early
> > >Christian scribes bases on the god Pan.
> > >Cormac.
>
> > Likewise, there is no connection between Satan, God(s) and reality.
> > It is possible of course, that Pan was real, in that Pan was an alien.
>
> > Humans on this planet originated from aliens having intercourse with
> > earthly 'creatures'. Aliens from different galaxies have different
> > appearances,
> > that's why we have different looking humans on the planet - Westerners,
> > Chinese, Mongolian, African etc. etc. etc...
>
> > These aliens came here, gave the local females a 'shot' wherever they
> > landed,
> > raided the land of all the 'Good Grass' , jumped back in their
> > spacemobiles
> > and buggered off!
>
> > The primitive male creatures scribed as best they could images of what
> > they saw, these images have manifested in mans imagination over time
> > to become what we now call Gods. The primary purpose of these Gods is
> > to keep as many bums on seats as possible to support an industry based on
> > myth.
>
> > The above theory CANNOT be proven nor disproven, therefore it is just
> > as valid as any of the so called 'Main Line Religions' about today.
>
> > Based on the above, I am thinking of building a church/religion, all I
> > need is a good catchy name and slogan for it. Any ideas?
>
> > Of course there will be a non refundable joining fee, forced monthly
> > donations, annual membership subscriptions, extra blessings for those
> > that make donations. The blessings will be a guaranteed never ending ride
> > in
> > a spacemobile when you fall off your perch.
>
> > I will have to get some weird looking robes to play the part of the scary
> > one.
> > A complete infrustructure will be put in place to accomodate the many
> > 'teachers' that we will have. Every teacher will be armed with a bong and
> > enough grass to blow away even the strongest of disbelievers minds!
>
> > All contributions for a startup fund can be emailed to me via this NG -
> > thanks.
> > I will personally ensure every cent is well spent.
> >It sounds good to me. Hey, we already got the Bad Guy...
> >http://www.seattlemet.com/assets/0001/3695/satan.jpg?...
> >Aliens should scare them even further.
>
> Looks like a reasonable type of chap to me! Its the 'other' fellow,
> the Magical one, we need to be concerned about, making it so that little
> children have to eat all that chocolate this time of year - huh!
> Yet again, another money spinner.

It's also good in scaring people one way or the other in democracy...

http://www.anorak.co.uk/wp-content/uploads/obama...

Religion is such a great helper for politicians.