![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#21 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
That's not OO, IR!
|
|
|
|
|
|
#22 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
I thought my solution was pretty nice
, you can always subclass it so you can swing the cat by the tail first or kick the dog's nose.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#23 | |
|
Professional Programmer
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4
![]() |
Quote:
Btw, Is anyone else experiencing major difficulties with the site?
__________________
-Steven "Is this a piece of your brain?" - Basil Fawlty |
|
|
|
|
|
|
#24 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Yes stevengs, read here.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#25 | |
|
Professional Programmer
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4
![]() |
Quote:
while( tired ){
while( cat_not_wailing )
sleep();
wake_up();
for( int i = 0 ; i < 9; i++ )
shoot_cat();
rejoice();
go_to( bed );
}
go_to(work);I just added the work part, of course I don't know many people in a position to go to work when they have rested enough that they are no longer tired.. ![]() but isn't that how most people live? .. work, sleep, .. repeat, with an occasional cat massacre thrown in.. ![]()
__________________
-Steven "Is this a piece of your brain?" - Basil Fawlty Last edited by stevengs; Jun 3rd, 2005 at 6:06 PM. |
|
|
|
|
|
|
#26 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
check out my post in the lounge for my highly important input on this matter.
BTW, I recently had my 300th post. W00t! |
|
|
|
|
|
#27 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,223
Rep Power: 5
![]() |
Quote:
self->set_possible_sleeping_state(asleep);
while( self->tired() && self->can_stay_in_bed() ){
while( animals->quiet() && alarm_clock->quiet())
self->attempt_to_sleep();
self->wake_up(half_way);
if (!alarm_clock->quiet())
{
self->hit(alarm_clock->snooze_button());
}
if (self->possible_sleeping_state() == asleep)
self->set_possible_sleeping_state(halfway);
else if (self->possible_sleeping_state() == halfway)
self->set_possible_sleeping_state(awake);
if (self->possible_sleeping_state() == awake)
{
if (!alarm_clock->quiet())
self->throw_object(alarm_clock, bedroom_wall);
}
self->get_up();
self->get(shotgun);
for( int i = 0 ; i < 9; ++i )
self->fire(shotgun, animals->those_making_noise());
if (animals->quiet())
self->rejoice();
if (self->possible_sleeping_state() == awake || alarm_clock->time() > time_to_get_up() - 30*minutes)
break; // leave loop
else
self->go_to(bed);
}
self->perform_morning_ritual();
self->go_to(work); .Last edited by grumpy; Jun 3rd, 2005 at 7:02 PM. |
|
|
|
|
|
|
#28 |
|
Hobbyist Programmer
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4
![]() |
I wish some day to be as logical and rational as grumpy ... *sigh*
[edit] I will try to be helpful to the best of my knowledge, although even at Devshed 90% of the time I came with questions and was helped by you, guys, 100% of the time, with more useful information than expected.Learning session continues ....... ![]() Last edited by EverLearning; Jun 3rd, 2005 at 8:26 PM. |
|
|
|
|
|
#29 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Is there a particular reason to shoot the cat nine times?
int bullets = 9;
while( alive ){
while( cat_not_wailing )
sleep();
wake_up();
aim();
if (bullets > 0) {
shoot_cat();
bullets--;
rejoice();
go_to( bed );
} else {
go_to( work);
buy_bullets(9);
bullets = 9;
}
}You have to be economical! Bullets cost money! The use of the bullets variable is purely for readability. It should be handled by the shoot_cat and buy_bullets function. Did you have cat massacres on DevShed? Care to clarify the sticky issue? I suppose I should search for that...I've had some downtime getting Gentoo going. |
|
|
|
|
|
#30 |
|
Programming Guru
![]() Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5
![]() |
maybe it was with a pellet gun, i shot a squirrel once with a pellet gun, didn't seem to do too much, although it penetrated the skin.
could one of you chronicle the legend of devshed for us? it seems like so much of an intriguing story.
__________________
i put on my robe and wizard hat... Have you ever heard of Plato, Aristotle, Socrates?...Morons. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|