Showing posts with label loop. Show all posts
Showing posts with label loop. Show all posts

Wednesday, December 15, 2010

In which Pearl struggles to write a code

Konbanwa, minna-sama.

As usual, I'm feeling very tired and lethargic. Add in some stress because the majority of my classes are "behind" the other Grade 9 Pre-IB classes of said subject, and you have the perfect formula for exhaustion. If it's possible to get more than 7 hours of sleep a night in the next few days, I'd like to take advantage of that. Otherwise I might really fall asleep in Science. (And no, I absolutely cannot afford that!)

I think my overall average went down a lot, and it's got me worried. I already knew that my Science mark would drop, I just didn't expect it to drop so much. I'm even dropping in ICS, and I feel horrible, especially after Mr. Arkin gave his speech about expecting us to get over 80% on the recent programming test. I made stupid mistakes...very stupid mistakes...

Anyways, today we continued working on the "Follow the Bounce" program. Last night (this morning?), I had gotten a large part of it done. The only problem was that there were (I'm exaggerating here) a million loops, so that even I got confused - and I was the one who wrote the thing! So, yes, when Randi came over and told Zarin and I that the program only needed to consist of one loop...I...cried. All my hard work, gone! Well, it's nothing to lose sleep over.

By the end of the period, I had gotten a pretty good idea of how to do it. Of course, that included a ton of desk checking (in my head, because it would take too long to do it on paper) and tracing the execution (with the computer). Now, I only need to fix a little glitch and it'll be perfect! Of course, I could never have gotten this far without help! Thank you to everyone who helped me, you know who you are!

I really like this program (staring at it is fun!), so I'm going to create an executable for it. I want to send it to my mom so she can see it (and maybe even show it off to her colleagues at work). Teehee.

For homework, I need to start on the "Window-edge Tracker" program. I have a pretty good idea about how to do it, but I don't want to spend an excessive period of time on it, since I have a big essay for English that I need to finish. I also agreed to editing Zarin-dono's essay (and I'm perfectly happy doing so - I don't mind at all)!

So, I'm off to work now.
Mata ashita, minna-sama!

Thursday, December 9, 2010

In which we review programming in groups

Kon'ichiwa, minna-san~!
Tonight was International Night, so Zarin-dono and I stayed at Maryvale library (at Parkway Mall) until around 5:30, when we walked back [to school]. (God, it was cold!)
Anyways, the entire show (concert?) was amazing! I'm so glad I decided to go. *smile*

Last night, Zarin-dono and I went through the Skills Inventory, briefly going over certain aspects of it and taking note of the concepts we didn't understand.

Anyways, yesterday I mentioned that we got into groups to help each other catch up/fully understand programming, right? We continued doing that today!

It was sort of funny, because I had no idea that there were two kinds of loops. When Mr. Arkin and Zelin tried to explain it to me, I got even more confused, and was like "ne?" *cue cute head tilt*
But eventually I understood! And when I did, I felt extremely stupid.

I think that my group made good progress today! We're going to continue doing that tomorrow. By Monday, I'm sure my group and I will be "Level  4" Computer Science students!

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!

Monday, November 29, 2010

In which Pearl struggles with substrings

I'm exhausted mentally and physically... My fault, for staying up until 2:30 AM last night (this morning). And I didn't even get to drink tea this morning, so I had to trudge through the entire day without any caffiene in my system. By fourth period (French), I was falling asleep. Derr.

Today, Mr. Arkin was away, so we had a guest teacher. She didn't say anything, just let us in. (She made sure we were doing our assignments, though, so that was good).

So, I set to work, tackling the Substring Assignments. It took me a while, but I finally understood the concept. It took me about half an hour to figure out how to do Question 1 properly, but hey, at least I managed to do it, right? After that, things went really smoothly. I got to Question 4 and finished about half of it. I think I'll work on it a bit tonight, and either finish it or continue on tomorrow.

On another note, the programming test is postponed until next week - I just checked the Daily Log! I don't know whether to celebrate or be exasperated that I spent the better part of my weekend studying instead of doing other homework for other subjects.

That said, I just want to mention that I saw my classmates from middle school today. I'm so glad I went to the library (near my house). We stopped and chatted for a while, then went our separate ways. It's nice to see old friends. Over Winter Break, I plan on going out with friends from my old school - Eaton Centre on the 21st, and somewhere else later with a friend I haven't seen since Grade 5. (We still talk to each other every day on MSN, though.)

Mata ashita, minna-san~!

Tuesday, November 23, 2010

In which Pearl gets a shock

Aw man, Mr. Arkin is hilarious.
"Some of you used special character entities for characters that are not special!"
Today was a great day.

We got our Printer Comparison marks today. Let's just say (again), I'm extremely happy with mine.

He started the less on by giving us a review on absolute and relative links (which, for me at least, was very much needed). An absolute link starts with a protocol, and can be used on any web page. A relative link does not start with a protocol, and can only be used on web pages that are in the same (root) directory as the file it links to.

An example of an absolute link is http://chibikarin22.deviantart.com/
(This links to my deviantART account.)

An example of a relative link is /EC/ICS2O/assignments/printer_comparison.html
(This tells the computer to start from the root directory and look for a folder called "EC", then look for a subdirectory in that directory called "ICS2O", and so on.)

Then he continued on by telling us about how we should properly write our HTML code. (Like the special character entity problem.)

After he finished his spiel (when I say "spiel", I don't mean for it to offensive, so please don't take it that way!), we went back to our computers and worked on Repetition Assignment 12. Not soon after, the bell rang, and I got a huge shock: I barely got twenty lines down! Grah...

Even after I got home, it took me at least half an hour to finish it. Zarin-dono Zarin-chan even pointed out that I got the GST and PST wrong. Heh. I guess I'm really tired today. And I have to write it out. The code is 104 lines...*cries*

On another note, I still have to finish that poem for the Lit section, write my News and Events article, and finish inking that birthday card for my friend from middle school. That's gonna be easy!

Ahem. Yeah, so until tomorrow, minna-sama!

Monday, November 22, 2010

In which Pearl kicks herself for making stupid mistakes

I did forget it at home.
By "it", I mean the code for the Modified Repetition Assignment Number 8.
...*depression*

And what's worse...is that I embarrassed myself in front of Mr. Arkin today. (But Zarin-dono was there with me, so that's okay! *shot*) Yeah... Trust me to display my terrifying math skills in front of a math teacher. Grah...

Today we continued working on our Repetition Assignments. Zarin-dono and I worked together on Question 9, which we ultimately finished with about ten minutes to spare. Why, you ask? That horrible math problem...
Zarin-dono's so good at it - she figured out the problem so quickly; whereas it would've taken me...hours(?) to solve it. Zarin-dono, I bow to your amazing arithmetic skills! *bows down*

Question 10 was started, but I barely got anything done on that part. I finished it at home, though. I also finished Question 11, and am in the process of writing out the code.
[Edit]: Nope, I'm done now. *cheers* And I put it in a folder that I always bring to school, so I won't "forget" this time! Ha!

On another note, I finished the Printer Comparison Assignment right before 10 P.M. last night, because I was afraid Mr. Arkin would change the FileZilla password. But he didn't, and I felt incredibly stupid. *cry*

I want to start on Question 12, but I need to leave soon. Plus I have Science, French and English homework as well.  Derr.

Ano, oyasumi, minna-san!
Soshite...mata ashita!

---

Trans. So, um, good night, everyone! And...until tomorrow!

Friday, November 12, 2010

In which we get our first official repetition lesson

Ne, ne, I can actually hit the target now! Sort of. Well...my best hit rate was 75%.
Grah...what am I saying? I'm still horrible.

Anyways, today we finally got to learn about repetition! The first thing Mr. Arkin showed us was a program that continued to show the text "Hello, world!" on one corner of the screen after another. He didn't show us the code, but instead moved on to teach us about loop.

When a certain action or actions need to be repeated, we use the loop procedure. Everything in the loop body gets repeated over and over until a certain condition is met. All the major actions that are repeated are inside what's called the loop body. To instruct the computer when to stop repeating these actions, you use the keywords exit when.

For example:

loop
     put i

     i := i + 1

     delay (1500)

     exit when i > 13

end loop

Yep. Except in here, "13" and "1500" are magic values. Normally you would use a constant (or variable, depending on the type of program) in their places.

As for what this program does, it simply incrememnts i (a given integer) by one every 1.5 seconds.
When i is greater than thirteen (in other words, when i is equal to 14), the computer stops looping these actions and performs the next action, if there is any. If not, then the program is finished.

Simple, ne? And I finished all the homework, too! Now all I have to do on the weekend is my science. And I want to draw a picture for Jessie's birthday, as well as continue my Durarara!! fic.

I wish Durarara!! had more backgrounds. I'm changing my background today (this morning?) because the current one is just too busy. I wanted to use a picture from DN Angel, seen below, but I couldn't find a...er, bigger one.

Risa-chan!
DN Angel belongs to Yukiru Sugisaki.
Therefore...I'm using my old Fate/Stay Night wallpaper. Hopefully you guys like it (yes, I really do care about that).

That's all I have to say about today. I've been feeling very...depressed these days. So, don't mind me if I suddenly slip into a younger version of myself. It's normal.

Ah, well. I should go to sleep now. I'll just change my background first. Sweet dreams, minna-san!