2 posts tagged “programming”
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
[--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