3 posts tagged “c language”
Yep...I'm blogging from our computer lab at school once again.
The program was simple enough for me to finish it in about 15 minutes, leaving me with two and a half hours of net surfing. The program this time was supposed to display the GCD of two numbers.
It would have taken me a few minutes shorter to accomplish this task had my brain not confused GCD with LCD. I kept on wondering why 2 and 5 returns 1 when it should be 10.
It was only after smacking my head on the monitor did I remember the principle behind GCD.
Needless to say, I smacked my head on the monitor right after.
x_x
Today, July 26, 1:04 AM local computer time, I have passed my week-worth's program at C.
Though, this is already the second assignment, I found a greater sense of fulfillment upon successfully writing this one. Why you ask? Merely because the first one only tested our patience at copy-pasting several lines over and over again.
That was the World Time Zones Converter. Not much of an intellectual challenge, really.
The second one, however, is far more brain-wracking.
I used to pride myself in being able to keep track of every variable's current status [ie value, pointer, allocation, etc] as the program moves down. This time around, said ability was tested to its limits. Literally.
Actually, the whole thing's more of a logic problem than a mathematical one [aren't they always?]. It's more of ignoring the mind's capability of making effective shortcuts and attempting to dissect your train of thoughts into miniscule parts and translating them into computer lingo.
I, for one, never knew converting from Arabic to Roman and vice versa had so many things to consider. Like, how to avoid IXCC for 209.
[Glances at wall clock] Oh, will you look at the time, it's getting late, er, too early.
Since I haven't received any Mailer Daemon til now, I can safely assume my homework reached its proper destination: Prof Collin's inbox.
By the way, the reason why I was awake til this ungodly hour is because our deadline was 6 AM today/later. And before you brand me as a crammer, I would like you to know that for the past week, my sleeping schedule was from 2 AM to 5 AM. All because of this program.
And now, I'll take my leave.
For my final words:
Riknata had 321 freakin' lambs.
Adieu.
n_n
[--Insert title here--]
I found out that Fanfiction.net does not recognize the following symbols when a file is downloaded as .odt : semicolons, backslashes, boolean signs, brackets, braces, ampersands, and percentage signs. I uploaded my C program from my pc station at the Computer Lab yesterday for reference. The take-home machine work was somehow related [I think] to the program we just made so I need to have a softcopy at home.
Being at school, internet was naturally restricted to limited sites, including Yahoo! Mail. Don't ask me why. It just is. I tried Yahoo! Briefcase but I was still denied access. That was when I realized exactly what was prohibited: logging on to the Yahoo! domain itself. So, there. I also gave a shot at eSnips but for some frustrating reason, it won't recognize any passwords I have entered. I tried several combinations and even used the theme from 2002. Silly, I know, but I still recall a few sites where I haven't renewed my password. It was a long shot. Anyway, it didn't work still. As a last recourse, I saved my program to OpenSource Writer [the university uses Ubuntu, a Linux interface] and uploaded it to Fanfiction.net.
Problem solved, not.
Back home, I retrieved the file and deleted it from my account. Opening it at Notepad, I was mildly suprised to see it in chaos. I was just glad the line breaks were still retained. I had no choice but to re-analyze the problem and conform to the remains of the skeleton I made.
After thirty minutes [I'm not boasting, it's naturally easier to solve problems when you've done them before], I then compiled it and checked my program. To my horror, the program started printing incredulously large numbers!! What the heck?
....
Then, like I said, I spent two hours trying several variations of the program and still getting the same ridiculous results. After a few bangs on the keyboard, and six pandesal, I found out the little miscreant. The actual statement was supposed to be:
for(x=0; buff[x] != '\0'; x++)
What I wrote was
for(x=0; buff[x] != '\0'; x++);
Notice the presence of a semicolon.
x_x
A/N:
Nah, not an update. DHW was kind enough to point out an error. :D