Konbanwa, minna-san~!
I'm so tired... Luckily, I don't have a lot of homework tonight. I'm going to draw: something I haven't done in a long time. I need to improve my skills. See, one day, I want to draw a manga. Nothing too long - it'll be a oneshot. I already have a few ideas floating around in my head, but I don't want to get into them here...
So, as the title of this blog post mentions, we learnt about functions today. If you take a look at my Programming Glossary, you'll see that the definition of a function is "a subprogram which returns a value". The actual structure of a function is actually quite simple. Take this for example:
function sum (integer1 : int, integer2 : int) : int
result integer1 + integer2
end sum
put sum (1, 2)
The program above will output the sum of 1 and 2, which is 3.
It is basically saying that sum will return the sum of two integers. integer1 and integer2 are parameters, and the : ints mean that those two parameters will hold integers. Parameters only exist locally, which means that they only exist inside the function body.
The last : int means that the datatype that sum returns must be an integer.
All function bodies must have at least one statement: the result statement.
Personally, I'm still a little confused about all this, but I'm sure I'll understand with time. I'm not a very fast learner, but with trials and tribulations (ha, did anyone catch the Phoenix Wright reference I made there? *wink*) I manage to "get" the concept with time.
For homework, I have to figure out how the nextConsonant function should look like, and modify some substring assignments so they have functions in them. Derr.
On an ending note (and no, this has absolutely nothing to do with computer science, but I really want to say this)...
If you haven't heard "Every Time You Kissed Me" by Emily Bindiger, go listen to it now!!! It's from an anime called Pandora Hearts, and it's a very pretty song. I happened to stumble on it by accident, when I found a piano instrumental cover for another song on YouTube. I went to the uploader's channel, and he decided to take a look at this song.
One day, I'd like to do a cover for this song...
Anyways!
Oyasumi, to mata ashita, minna-sama!
---
Translation:
Good night, and see you tomorrow, everyone!
No comments:
Post a Comment