Showing posts with label binary code. Show all posts
Showing posts with label binary code. Show all posts

Wednesday, December 8, 2010

In which we learn about procedures

Konbanwa, minna-san!
I...get obsessed with different series very easily. Sometimes my love for a certain series dies out. (For example, I used to adore Hot Gimmick, but now it's...meh. It's not like I don't love it anymore (I mean - who can resist Ryoki-sama? *wink/fangirl squeal*), but it's just not as important to me.) But at other times, I will continue to love that series forever and ever... Like Inuyasha. I started watching it, what, six...years ago? I still adore it. And FullMetal Alchemist, which I started watching at around the same time. Of course, I absolutely cannot forget Detective Conan/Case Closed~! I'm a huge mystery/detective fan, so I love this one. Right now, I love Durarara!! It has a really unique/amazing/epic/addictive storyline and even more unique/amazing/epic/addictive characters. I don't want to stop loving it...


From left: Izaya Orihara, Anri Sonohara, Mikado Ryuugamine, Masomi Kida, Shinra Kishitani, Shizuo Heiwajima. The figure in the moon is Celty Sturlson, a dullhan.
Durarara!! (c) Ryohgo Narita
 Ah, but these are simply the ramblings of a crazy fangirl/writer. To get back on topic...

According to my Programming Glossary, a procedure is a subprogram that performs a defined task. It is very similar to a function. However, a procedure does not have a result (because it's not returning a value) and it can have zero or more arguments. An example of a procedure with zero arguments looks like this:

procedure sayHello
     put "Hello!"
end sayHello

sayHello

This code outputs "Hello!"
However, you can "upgrade" it, using an argument. This code will output "Hello, Shizu-chan!"

procedure greetUser (greeting : string, userName : string)
     put greeting + ", " + userName + "!"
end greetUser

greetUser ("Hello", "Shizu-chan")

Simple, ne? *smile*
Of course, if this was Izaya-kun speaking, Shizu-chan would say: "Get out of Ikebukuro!!!"
D'awws, we love you, Shizu-chan~

You can also ask the user to give you the greeting and name. However, then you must make greeting and userName variables (within the procedure, if that makes sense).

procedure greetUser (var greeting : string, var userName : string)
     put greeting", " + userName"!"
end greetUser

var greeting : string
var userName : string

put "Greeting? " ..
get greeting : *

put "Name? " ..
get userName

greetUser (greeting, userName)

Got it? *smiles again*

Well, I hope that explanation was plausible. I'm generally horrible at explanations (and you wonder how I'll ever become a teacher).

Anyways, after we were taught how to create a procedure, we evaluated ourselves on our understanding of programming. Then we got into groups based on our evaluation. By Friday, Mr. Arkin wants us to fully understand all the concepts of programming! With a bit of work, I'm sure we can do it~!

Ganbatte, minna-san~!

Wednesday, December 1, 2010

In which Pearl tries to simplify her codes

Argh! I'm going to keep this short, because I have yet to start my lab report, which is due tomorrow. My fault, I spent way too much time reading that White Pine book. Which reminds me, if any of you have any time, go to the (public) library and look for Fear the Worst by Linwood Barclay. It's really good - I couldn't stop reading...until my friend, Keshini, called me. Yup.

We had a Spirit Assembly this morning! It didn't cut into this class, though. The X-Country team had to run out three times... Not that I mind.

Mr. Arkin was away again today - apparently he'll be back on Friday. I feel frustrated, because I still don't really understand the concept of substrings, and we're having a substring quiz on Friday.

I worked on simplifying my codes for Assignment 8 and 10 today. Unfortunately, it took the entire period for me to figure out how to do it. I feel pathetic.

That's pretty much it. In order to avoid writing out my science lab report, I'm going to finish a few more assignments now.

Oyasumi, minna-san!

Friday, October 22, 2010

In which we learn how to add colour to programs

I realize...I'm going to miss five days of school this month. I was already absent for three days, all for X-Country meets. Then on Tuesday next week, I'll be away for Metros (also X-Country) and on Thursday of next week, the Grade 9 science classes will be going to Rouge Valley.
Now that I think about it, there's also a possibility that I'll miss school on November 3rd for Take Your Kids to Work Day.

Oh, and this is completely off-topic, but: in class today, after Zarin told me what happened to her, I realized that my chances of getting hit by a car are higher when I'm sleepy. For example, there was a time when I almost got hit by a car twice in the same day.
I space out when I'm tired.

Going back to the topic of Computer Science...

Today we learnt how to change the text and background colour in the run window, for Turing. There are two keywords we can use: colour, which changes the text colour; and colourback, which changes the run window's background colour. I have yet to experiment with these keywords, but I plan on doing so over the weekend.

We also learnt how to put in special characters. (And this is where ASCII comes in!) There are two keywords that we use: ord, which stands for ordinal; and chr, which stands for character.
For example, if you want to put the capital letter "A", you can write either one of these programs:

#1:
put ord ("A")

#2:
put chr (65)

And...I guess that's it. I've been listening to Canterella by Kaito Shion (one of the Vocaloids - computer-generated voices) for the past hour. I love that song!
I'll shut up before I start fangirling about Kaito.

Ja ne~!

Wednesday, October 6, 2010

And I go back to being a "detective"

Oh, yes, another day where I got extremely hyper. And that email from the PP Lit section just boosted my happiness a few more levels! *dances around in joy*

Anyways, today's class was really fun - and tiring at the same time. Mr. Arkin gave us a worksheet on binary code. I loved trying to figure out which character is which. I always loved trying to solve codes - I had dreamed of being a spy or secret agent when I grew up, or a detective. So, naturally, I learnt as many codes as I could.

As soon as I finished the worksheet (which was, to my surprise, relatively fast), I went to my computer to find Mr. Arkin's last blog entry. It was completely written in binary code! Nevertheless, I always enjoy a challenge: especially if it's this fun and exciting!

I finished decoding it a few minutes ago. I desperately want to post the translation up here, but I won't. Because I'm a good girl~!

All in all, today's class was really fun and relaxing. It sparked my old desire to be a detective, and gave me a nostalgic feeling. I think I'm pretty familiar with binary code now. :)

01010100 01101011 01100100 01100001 01111001 00100000 01110111 01100001 01110011 00100000 01010100 01101000 01100101 00100000 01100010 01100101 01110011 01010100 00100000 01100011 01101100 01100001 01110011 01110011 00100000 01110011 01101011 00100000 01100110 01100001 01110010 00100001