Since Shoutbox is still down, how about we have some fun.

Discussion in 'Off Topic Discussion' started by Yatty, Jan 11, 2017.

  1. Yatty

    Yatty Yatt'em VIP Silver

    It's currently 7:21 am and my programming class doesn't start till 8:30 am. Instead of sitting here bored looking through threads I felt like trying to teach those that care how to think like a programmer. I'll go ahead and put my very first lesson below, feel free to ask questions if you don't understand.


    Mechanical Man
    Program the Mechanical Man to carry out the following objectives:

    1) Begin sitting in a chair at an unknown integer number of steps from the wall with his arms lowered.

    2) He will stand up and walk forward until he touches the wall with his fingertips.

    3) After touching the sall, he will return to his chair.

    4) Because the chair is too low for him to sense, he can get to it only by going back exactly the number of steps as he came forward.

    The Mechanical man possesses the following properities:

    * He is restricted to carrying out a limited set of instructions.

    * He does nothing unless given a specific instruction.

    * He must carry out any instructions he is given one at a time.

    * He understands only the following instructions:

    Physical Movement:
    - Stand up
    - Sit down
    - Take one step
    - Raise arms
    - Lower arms
    - Turn right 90 degrees

    Arithmetic:
    - Add one
    - Subtract one
    - Record total

    Logic: The mechanical man can decide what instruction he will carry out next on the basis of answers to the following questions:
    Arithmetic Results:
    - Is the result positive? or negative? or zero?
    - Is the result equal to a predetermined amount?
    Physical status:
    - Are the raised arms touching anything?
     
    • Winner Winner x 2
    • Like Like x 1
    • Creative Creative x 1
  2. Vivi

    Vivi VIP

    To lazy to think
     
    • Agree Agree x 3
  3. PixeL

    PixeL Deathrun Developer Mod Silver

    Is the answer 42?
     
  4. Yatty

    Yatty Yatt'em VIP Silver

    I mean, you're not wrong.
     
  5. PanzerShrimp

    PanzerShrimp Best Member Diamond VIP

    cout "fuck that" ;
     
    • Funny Funny x 1
  6. PanzerShrimp

    PanzerShrimp Best Member Diamond VIP

    Seriously that sounds like a bitch to have to code that
     
  7. Solar

    Solar Invulnerable Admin VIP

    I do not know :(
     
  8. Yatty

    Yatty Yatt'em VIP Silver

    It's actually not all that difficult. Simple problem solving with really easy to understand syntax.
     
  9. Yatty

    Yatty Yatt'em VIP Silver

    Stand up

    Raise arms

    Take one step

    Add one

    Is the result negative?

    Take one step

    Add one

    Are the raised arms touching anything?

    Is the result positive?

    Record total

    Lower arms

    Turn right 90 degrees

    Turn right 90 degrees

    Take one step

    Add one

    Is the result equal to a predetermined amount?

    Is the result negative?

    Take one step

    Add one

    Is the result positive?

    Turn right 90 degrees

    Turn right 90 degrees

    Sit down
     
    • Winner Winner x 1
  10. shanty

    shanty Active Member

    does scratch count as programming?!?!?!?!?!?
     
  11. Yatty

    Yatty Yatt'em VIP Silver

    Yes.