Author Topic: My schoolwork got rejected...  (Read 16843 times)

0 Members and 2 Guests are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: My schoolwork got rejected...
« Reply #15 on: May 18, 2010, 12:01:41 pm »
It reminds me my last school project how I did not include a highscore system. I was making a adventure type game and they wanted us to put a highscore system in our game. WTF? I just decided to ditch it. It costed me 20 pts out of 100. However I didn't care because I was still the best person in the class in average for the entire year and it did not affect my overall school classes average enough. I got 80% on the game, btw

Offline mapar007

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 550
  • Rating: +28/-5
  • The Great Mata Mata
    • View Profile
Re: My schoolwork got rejected...
« Reply #16 on: May 18, 2010, 01:42:06 pm »
OMFG if he doesn't understand it, he should either give you an A, or voluntarily resign. (you see, this is one of the reasons why I never wanted to take comp classes at school)

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: My schoolwork got rejected...
« Reply #17 on: May 18, 2010, 04:29:31 pm »
I think I should point out before my teacher gets bashed too bad that he was the teacher that taught me TI-Basic... ;D

Offline Tribal

  • The Fallen
  • LV5 Advanced (Next: 300)
  • *
  • Posts: 218
  • Rating: +15/-1
    • View Profile
Re: My schoolwork got rejected...
« Reply #18 on: May 18, 2010, 04:35:00 pm »
Oh wow, I can't believe a teacher actually rejected a work that WORKS and is more OPTIMIZED, if it was to complex for him he should have just given you an A+. Next time he asks you to rewrite the program ask him if he'd feel better if you teached the class :P

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: My schoolwork got rejected...
« Reply #19 on: May 18, 2010, 04:37:31 pm »
Lol XD

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: My schoolwork got rejected...
« Reply #20 on: May 18, 2010, 09:02:25 pm »
If he does it again just turn in one of your calc games to him instead since he apparently knows TI-BASIC :P
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: My schoolwork got rejected...
« Reply #21 on: May 18, 2010, 09:29:09 pm »
If he does it again just turn in one of your calc games to him instead since he apparently knows TI-BASIC :P
I showed him Exodus a couple of weeks ago.  I got the same response. ;D
Text sprites FTW! ;D

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: My schoolwork got rejected...
« Reply #22 on: May 18, 2010, 09:29:45 pm »
Haha very nice.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Re: My schoolwork got rejected...
« Reply #23 on: May 18, 2010, 11:27:50 pm »

What Quigibo wrote is very true. You're talking to a self-taught programmer that went through the trials and tribulations of learning everything, that he already knew, in AP Computer Science. As you grow as a programmer you will come to realize the reasons why they teach the way they do.

At any rate, at face value those two pieces of code appear to do the same thing correct? But have you compiled it on every compiler new and old? This is an issue faced by lots of companies in the real world that are supporting legacy code that may need to be built with older compilers, etc. Believe it or not there is a compromise! You can keep your optimized version while simultaneously making your code easier to understand and more portable. Have the compiler do the pointer arithmetic for you:
Code: [Select]
#include <fstream>
#include <iostream>

void main()
{
char string[25];
char header[5][10] = {
{"Name"},
{"Address"},
{"City"},
{"State"},
{"ZIP Code"}
};

int offset = 0;
file_ptr.open("ADDRFILE.DAT", ios::in);
if (file_ptr)
{
do
{
file_ptr.get(string, 25);
file_ptr.ignore(80, '\n');
if (!file_ptr.eof())
cout << header[offset % 5] << ":" << string << "\n";
++ offset;
}
...etc
So I guess the main point here is, don't over-complicate things, and remember that portability is an issue. Other than that, I would like to say good job on taking the incentive to go above and beyond the accepted normalities; keep the drive going!
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: My schoolwork got rejected...
« Reply #24 on: May 18, 2010, 11:31:58 pm »
ohai Halifax

I think portability is a good point to raise too. I do not know C but in the past I learned about programming some stuff and programmign teachers kept reminding us to make sure our code is portable (both by being useable in multiple apps without modifying too much and if possible cross-platform)

Offline necro

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1295
  • Rating: +17/-2
  • +3 vaporal mustache
    • View Profile
Re: My schoolwork got rejected...
« Reply #25 on: May 19, 2010, 01:11:04 am »
I'm going to agree with Halifax, In a programming job, readability, maintainability, and portability are likely to be more important than speed most of the time because other people will have to read and edit your code and very few apps (mainly those with sound or graphics) will max out a processor, so the trade off probably isn't worth it. Imagine a project of 6k lines of this and the migraine it would cause, even if its faster. Also, comments are always a good idea whenever clever code is employed.

What kind of class is it?
« Last Edit: May 19, 2010, 01:18:00 am by necro »
I'm like a woot burger with awesome fries


VB.Net, C#, C++, Java, Game Maker

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: My schoolwork got rejected...
« Reply #26 on: May 19, 2010, 01:40:18 am »
That said, I think if speed is really a big concern, code should be as optimized as possible, though. Otherwise, we end up with stuff like Halo 2 PC and other games that takes too much ressources for what they do.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
Re: My schoolwork got rejected...
« Reply #27 on: May 19, 2010, 11:13:32 am »
Haha, hey DJ_Omnimaga. :D Yeah, it's been a while since I've gotten time to get back into calculators.
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: My schoolwork got rejected...
« Reply #28 on: May 19, 2010, 11:41:11 am »
Sorry to hear D: sometimes life can get pretty hectic when it comes to free time x.x

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: My schoolwork got rejected...
« Reply #29 on: May 19, 2010, 04:59:54 pm »
Imagine a project of 6k lines of this and the migraine it would cause, even if its faster. Also, comments are always a good idea whenever clever code is employed.
I can imagine; I just printed out the source to The Penguin 77's Tetris Marathon (64 pages) and Quigibo's Puyopuyo (49 pages) in an attempt to learn Asm. ;D  It's pretty cryptic, but it's fast. :D  (*ZTrumpet is just weird... ;D )
Despite the comment I just made, I completely agree with you, necro. :)  I should have probably commented and coded better earlier. :)

Code: [Select]
#include <fstream>
#include <iostream>

void main()
{
char string[25];
char header[5][10] = {
{"Name"},
{"Address"},
{"City"},
{"State"},
{"ZIP Code"}
};

int offset = 0;
file_ptr.open("ADDRFILE.DAT", ios::in);
if (file_ptr)
{
do
{
file_ptr.get(string, 25);
file_ptr.ignore(80, '\n');
if (!file_ptr.eof())
cout << header[offset % 5] << ":" << string << "\n";
++ offset;
}
...etc
So I guess the main point here is, don't over-complicate things, and remember that portability is an issue. Other than that, I would like to say good job on taking the incentive to go above and beyond the accepted normalities; keep the drive going!
Halifax, that's pretty great code!  Thanks for sharing it, and I think it better than my version.  Awesome job! ;D

What kind of class is it?
It's an introduction to C++ that I'm taking.  As you can tell, we are learning about data files right now. :)