Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 3rd, 2005, 5:02 PM   #21
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
That's not OO, IR!
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Jun 3rd, 2005, 5:13 PM   #22
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
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
nnxion is offline   Reply With Quote
Old Jun 3rd, 2005, 5:19 PM   #23
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
Quote:
Originally Posted by mitakeet
...lot of other ex DevShed-ers already here...
I wonder if JC realizes how badly he shot himself in the foot? Lost all his big guns. I remember the first post I read at DevShed. Scorpions4Ever walked, in his infinite patience, a guy that probably couldn't find his way out of a wet paper bag through a 63 post, hand-holding marathon ending in a successful installation of FreeBSD ( from scratch ). It is people of the calibre of the ones that just recently left DevShed in an act of solidarity ( excluding myself of course, being the charity case that I am, beneficiary if you will ), that make these forums so worthwhile. I haven't had much time, but I have seen some very good threads here at PF too.. I am glad I came.

Btw, Is anyone else experiencing major difficulties with the site?
__________________
-Steven
"Is this a piece of your brain?" - Basil Fawlty
stevengs is offline   Reply With Quote
Old Jun 3rd, 2005, 5:21 PM   #24
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
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
nnxion is offline   Reply With Quote
Old Jun 3rd, 2005, 5:56 PM   #25
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
Quote:
Originally Posted by Ooble
That's not OO, IR!
something was disturbing me... i figured out what it was... it was the while(sleeping) logic!


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.
stevengs is offline   Reply With Quote
Old Jun 3rd, 2005, 6:02 PM   #26
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
check out my post in the lounge for my highly important input on this matter.

BTW, I recently had my 300th post. W00t!
uman is offline   Reply With Quote
Old Jun 3rd, 2005, 7:00 PM   #27
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,223
Rep Power: 5 grumpy is on a distinguished road
Quote:
Originally Posted by stevengs
something was disturbing me... i figured out what it was... it was the while(sleeping) logic!
Your logic is still highly idealistic. I suggest a significant restructuring to make it more realistic.
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);
This structure allows for several real-world possibilities which yours does not .

Last edited by grumpy; Jun 3rd, 2005 at 7:02 PM.
grumpy is offline   Reply With Quote
Old Jun 3rd, 2005, 7:28 PM   #28
EverLearning
Hobbyist Programmer
 
EverLearning's Avatar
 
Join Date: May 2005
Location: Indiana
Posts: 130
Rep Power: 4 EverLearning is on a distinguished road
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.
EverLearning is offline   Reply With Quote
Old Jun 3rd, 2005, 9:36 PM   #29
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
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.
Dameon is offline   Reply With Quote
Old Jun 4th, 2005, 1:48 AM   #30
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5 bl00dninja is on a distinguished road
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.
bl00dninja is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:58 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC