http://behindeyesonly.livejournal.com/ ([identity profile] behindeyesonly.livejournal.com) wrote in [community profile] fandomhigh2007-03-13 01:59 pm
Entry tags:

[Computer Science - Week 10, 4th Period]

To the Journalism classroom again, and Logan smiled as everyone filed in, the desks had all been pushed to the sides of the classroom to leave a wide open space - except one, which had a handout on it for everyone to take.

"Welcome back, guys. Today we're going to program a robot," he said, gesturing towards his desk, where there stood a half a dozen or so robots, each about a foot tall.

"Inside the robot is the computer and the robot's body carries out the program you give it - you can think of the computer as its brain and the program as a set of commands it has to follow. Computers can be programmed to do just about anything, though the more specific a direction or fine-tuned the action you require, the more language it takes to make up the program.

"Computers have their own languages, even, which simplify the process of creating programs - even if the languages themselves can be a pain to learn. But if you were to write out exactly what you wanted a program to do in English, you'd end up with programs that took so much effort to store, the computer would have no energy left to carry them out." Logan leaned over to press a button on his laptop, the screen at the head of the class blinking on to show a bit of computer code.

// my first program in C++

#include
using namespace std;

int main ()
{
cout << "Hello World!";
return 0;
}


"Now all that? Would make the computer type out this-" Logan pressed another button and the screen turned black, typing out:

Hello World!


"Imagine how much code it would take to create a program that, say, balanced your budget." Logan smiled and gestured to the robots again.

"I'd like you all to pair up and take a robot. Between the two of you, decide what you want the robot to do, a simple goal, and then you have to give the robot your program. To make this a bit easier, your program just has to be a list of oral commands - stand, sit, turn around, for example. But keep in mind, the robot - or this one at least - doesn't think like a human. So whatever you tell it to do, it'll do that exactly.

"I want your program to be at least five separate commands long and then turn it in to me at the end of class. Those of you who already know and love programming? Write me a short Lisp based program as well. Have fun, guys."

[OOC: So I forgot to actually post the class after writing it. Here it is! Bear with me for a little bit of slow play on the robots and a break of an hour or so from 5pm PDT to 6pm PDT while I commute home.

Oh, and the extra programming is completely handwavey, just gives the superhackers a little more to keep them busy. Like I know Lisp? Pfft.]

[Syllabus/Attendance]

Re: Program

[identity profile] imac-kenzie.livejournal.com 2007-03-13 11:46 pm (UTC)(link)
Mac smiled. "Doesn't look like it," she said. "Wanna help me order one of these things around?"
the_merriest: (I have a Cunning Plan (TM))

Re: Program

[personal profile] the_merriest 2007-03-13 11:56 pm (UTC)(link)
"Absolutely!" Rikku grinned. "I don't know much about these computer things, but I have bossed around a mech or two in my time."

She nodded at the robots. "Which one do we want?"

Re: Program

[identity profile] imac-kenzie.livejournal.com 2007-03-13 11:59 pm (UTC)(link)
"I like pink," Mac declared. "How 'bout that one?" she asked, pointing at one in a particularly bright shade in the middle.

"Mech?" Mac queried as she moved closer to the robots. She knows computers, but that's one term that she hasn't come across before.
the_merriest: (aha)

Re: Program

[personal profile] the_merriest 2007-03-14 12:07 am (UTC)(link)
"Oooh, I like. Nice and bright." She bounced a bit, walking over to it.

"Mechs are sorta - what did he call these? Robots? I think it's the same kinda thing. You type stuff into a terminal and tell it to patrol and smack anybody it hits, and then it goes off to do it so long as nobody breaks it or it goes crazy. Which lots of people did, and the mechs sometimes did too, but it still helped some." Rikku shrugged. "We didn't use language like that, though."

Rikku seemed to think the above was perfectly logical, and was examining the pink robot.

Re: Program

[identity profile] imac-kenzie.livejournal.com 2007-03-14 12:12 am (UTC)(link)
"So... you know how to make ours follow our commands and not go crazy?" Mac asked. Robotics, wasn't really her strong point, so having someone who knew how these things went was definitely a bonus.
the_merriest: (hmmmmm)

Re: Program

[personal profile] the_merriest 2007-03-14 12:22 am (UTC)(link)
Rikku chewed her lip. "Kinda. I mean, I think I do? You've gotta define terms, I know that. You can't just tell it 'go over there and patrol for an hour' until it knows where you mean by 'there' and how to count to an hour. Oh, and what patrolling is anyway."

Re: Program

[identity profile] imac-kenzie.livejournal.com 2007-03-14 12:26 am (UTC)(link)
"Makes sense," Mac said with a quick nod as she went to lead the robot over to a clear space. It wasn't very cooperative.
the_merriest: (confused now)

Re: Program

[personal profile] the_merriest 2007-03-14 12:34 am (UTC)(link)
Rikku put her hands on her hips. "I wonder if this is the first part of the task-thing?" Or else they had a particularly grumpy mech. Great.

She knelt down and looked for a panel. "How do we input commands? He said oral, but I don't know if you have to use that C++ language. I don't speak it."

Re: Program

[identity profile] imac-kenzie.livejournal.com 2007-03-14 12:43 am (UTC)(link)
"I don't know anyone who actually speaks it," Mac said. "That's a level of dork that even I haven't reached yet."
the_merriest: (science-y)

Re: Program

[personal profile] the_merriest 2007-03-14 12:57 am (UTC)(link)
Rikku giggled at that. "Well, that's a relief. I'm not sure how you'd pronounce half of those expressions anyway."

She eyed the robot suspiciously. "Pink Mech-Robot! Roll forward three inches, now!"

Worth a shot?
the_merriest: (oooh! neat!)

Re: Program

[personal profile] the_merriest 2007-03-14 01:18 am (UTC)(link)
Rikku waved a fist in triumph. "All right!"

Re: Program

[identity profile] imac-kenzie.livejournal.com 2007-03-14 01:23 am (UTC)(link)
Mac arched an eyebrow. Glowy eyes, creepy. "That wasn't so hard," she remarked calmly.

"... so, what task do you think we should program it to do?" she asked.
the_merriest: (headscratch)

Re: Program

[personal profile] the_merriest 2007-03-14 01:25 am (UTC)(link)
"We could ... send it down the hall and back? No, it might have trouble with the doors." She considered. "I wonder if we could get it to do the hula."

Re: Program

[identity profile] imac-kenzie.livejournal.com 2007-03-14 01:31 am (UTC)(link)
Mac frowned at the robot. "Does it have the flexibility for that?" she queried. "Uh..." she cleared her throat, and commanded the robot, "lean 30 degrees forward." Talking to inanimate objects was an odd feeling.
the_merriest: (i rock)

Re: Program

[personal profile] the_merriest 2007-03-14 01:44 am (UTC)(link)
"Awesome!" Rikku laughed. Then cleared her throat. "OK, let's see if we can't get the arms in!"

"Pink-Mech-Robot! Straighten to standing. Then lean 30 degrees forward again, while moving both arms to the left."