Home

News

Forums

Hardware

CPUs

Mainboards

Video

Guides

CPU Prices

Memory Prices

Shop



Sharky Extreme :


Latest News


- Outdoor Life: Panasonic Puts 3G Wireless Into Rugged Notebooks
- Averatec Launches Lightweight Turion 64 X2 Laptop
- Acer Fires Up Two New Ferrari Notebooks
- Belkin Debuts Docking Station for ExpressCard-Equipped Notebooks
- Logitech 5.1 Speaker System Puts Your Ears At Eye Level
News Archives

Features

- SharkyExtreme.com: Interview with ATI's Terry Makedon
- SharkyExtreme.com: Interview with Seagate's Joni Clark
- Half-Life 2 Review
- DOOM 3 Review
- Unreal Tournament 2004 Review

Buyer's Guides

- September High-end Gaming PC Buyer's Guide
- September Value Gaming PC Buyer's Guide
- October Extreme Gaming PC Buyer's Guide

HARDWARE

  • CPUs


  • Motherboards

    - Gigabyte GA-965P-DS3 Motherboard Review
    - DFI LANPARTY UT nF4 Ultra-D Motherboard Review

  • Video Cards

    - Gigabyte GeForce 7600 GT 256MB Review
    - ASUS EN7900GT TOP 256MB Review
    - ASUS EN7600GT Silent 256MB Review
    - Biostar GeForce 7900 GT 256MB Review





  • SharkyForums.Com - Print: Oh GOD

    Oh GOD
    By alienrash April 25, 2001, 02:00 PM

    Lets hope they don't get a job programming anything vital. Mind you, this person "passed" their C and database class. How, you guess.

    import Sticks;
    import java.io.*;

    public class Game_Board
    {

    public static int [] pile = new int[3];
    static int count = 0;

    void stix_state (int [] state)
    {
    state[0] = pile[0];
    state[1] = pile[1];
    state[2] = pile[2];

    boolean make_move;
    int pile_number;
    int remote_number;

    if (2 < pile_number) return false;
    if (0 > pile_number);
    if (0 >= remote_number) return false;

    if (pile [pile_number] >= remote_number)
    pile [pile_number] = pile [pile_number] - remote_number;
    count ++;
    return true;
    }
    }

    class Game_Board1
    {

    public static int [] pile = new int[3];
    static int count = 0;
    {
    boolean game_end;
    if (pile [0]= 0 && pile [1] = 0 && pile[2] ==0)
    return ture;
    else
    return false;
    }
    }

    public class Default
    {
    pile[0] = 3i
    pile[1] = 5i
    pile[2] = 7i
    }
    public class Main
    {
    import java.io.*; //open io library (needed for readLine)

    Class 1
    static inside main(String[]args)

    BufferReader stdin new BufferReader
    Player 0 my_player 0 = new Player 0();
    Player 1 my_player 1 = new Player 1();

    int [] number_in_pile = new Player1();
    int turn = 0,
    move count=0;
    boolean end game = false;
    gameboard my_gameboard = new gameboard()

    System.out.println("Welcome to Sticks");
    System.out.println("You will be playing the computer");
    System.out.println("Which player would you like to go first");
    System.out.println("Please enter a c for Computer or a h for Human");

    response = Keyboard.readString();
    if (response = c);
    player1 = computer;


    while (end_game = false)
    my_gameboard stix_state (number_in_pile);
    for (int i=0; i<3; i ++)
    system.out.println (number_in_pile[i]);
    move count = move count + 1;
    if (turn == 0) my_player 0 getmove(my_gameboard);
    if (turn == 1) my_player 0 getmove(my_gameboard);
    }

    }


    }
    }

    By H.Golnabi April 25, 2001, 02:16 PM

    Ahem...what does that do?
    For a C newbie

    By alienrash April 25, 2001, 03:00 PM

    This is supposed to be a game of pick up sticks.

    This code would take you days just to get compiled let alone getting the logic correct.

    Mind you, this is a SENIOR LEVEL College course in Management Information Systems major.

    By kid A April 25, 2001, 05:49 PM

    So he got lucky: he passed his exam with no knowledge. Don't be jealous

    By Slovin8 April 25, 2001, 11:04 PM

    What C? This is a Java code. From what I read from .NET, Microsoft C# will follow some of Java syntax (which I hate very very much) but it will have at least a garbage collector (which I like very very much).

    What was this code for again? and what level? you're sure it's not a senior level at some highschool?

    By Pestilence April 26, 2001, 02:11 AM

    If that code represents bad programming then what should the program have looked like code-wise?

    By Pestilence April 26, 2001, 02:19 AM

    Hmmm I hadn't really looked over the code when I posted. Now that I see it's java and read it I see what you are talking about. Anyone with one semester of Java could have done better. Not only does it not compile, but where is the documentation? This person simply must not have taken any Java before doing this. The comparison staements aren;t even right for Heaven's sake.

    By alienrash April 26, 2001, 11:20 AM

    quote:Originally posted by Slovin8:
    What C? This is a Java code. From what I read from .NET, Microsoft C# will follow some of Java syntax (which I hate very very much) but it will have at least a garbage collector (which I like very very much).

    What was this code for again? and what level? you're sure it's not a senior level at some highschool?


    Maybe I should learn to write better. Yes, this is Java. This is a SENIOR level MIS class in College. This person needs this class to grad, in which they already failed it once.

    In reference to the C class and DB class. Java is so so so much easier to code than C, yet some how they managed to pass that class.

    Now, in the DB class, well, imagine 30 tables in which every table has a foreign key to every other table.

    Yet they passed?

    By Pestilence April 26, 2001, 05:36 PM

    Can you post the java code to the Sticks class please?

    By alienrash April 26, 2001, 07:27 PM

    quote:Originally posted by Pestilence:
    Can you post the java code to the Sticks class please?

    This is the code. There are no other classes defined. This is what was in place just 24 hours before the assignment was due. It dawned on them that they might need help. Ummm where do you start?

    By Adisharr April 26, 2001, 10:49 PM

    quote:Originally posted by alienrash:
    Lets hope they don't get a job programming anything vital. Mind you, this person "passed" their C and database class. How, you guess.

    Why don't you help them instead of posting their 'crappy' code..

    Hell if I posted everything wrong my customers did I'd be typing all day long. Not everyone is good at all things..

    By namgor April 26, 2001, 10:51 PM

    What kind of damn college is that? (is that your point?) I know York University let anyone to get a degree w/o knowing things, thats why, as an employer, you should not hire anything less than U of T.

    Anyway, senior yr course can be a geneal course? They let ppl pass easier, unlike a course dedicated to CS major whatever.

    By alienrash April 26, 2001, 11:54 PM

    quote:Originally posted by Adisharr:
    Why don't you help them instead of posting their 'crappy' code..

    Hell if I posted everything wrong my customers did I'd be typing all day long. Not everyone is good at all things..


    Yes, people have tried to help. This person has not learned (past occurances) of coming for help hours before it is due.

    The only help then, would have been to write for them. Something many others have done, and yet we still do not learn.

    Crappy code? I've seen and written crappy code. Let alone it compiles, it works. This just takes the cake.

    I have no compasion for a person who cheats their way through life, let alone college and then expects people to take them as legit.

    By Pestilence April 27, 2001, 12:51 AM

    Gish, that IS some very bad programming there. God awful for sure. If I knew the logic behind the programI think I could get it running well. This has kind of become a pet project of mine. Could you post a link to the assignment please?

    By Slovin8 April 27, 2001, 02:47 AM

    This is funny, I'm a sophomore and I have to write a program that solves differential equations in scheme in a week!

    quote:
    In reference to the C class and DB class. Java is so so so much easier to code than C, yet some how they managed to pass that class.

    True, java is easier but you don't write applications in Java unless your designing something specifically for the web. Java virtual machine is slow, this is just the deal. Plus, Java designers thought that by removing the word pointer and replacing it by "refrence", they solved memory allocation/de problems. This is given at the expense of the flexibity and elegance of pointer manipulation. If you know how to deal with pointers then you shouldn't worry about it. I guess I'm a bit off topic here

    By alienrash April 27, 2001, 07:07 AM

    quote:Originally posted by Slovin8:
    This is funny, I'm a sophomore and I have to write a program that solves differential equations in scheme in a week!

    True, java is easier but you don't write applications in Java unless your designing something specifically for the web. Java virtual machine is slow, this is just the deal. Plus, Java designers thought that by removing the [b]word pointer and replacing it by "refrence", they solved memory allocation/de problems. This is given at the expense of the flexibity and elegance of pointer manipulation. If you know how to deal with pointers then you shouldn't worry about it. I guess I'm a bit off topic here
    [/B]

    Yes! If you can handle C then you should be able to handle Java. It is a lot simpler. This person "passed" their C class.

    As for only writing Java for the web, no. Cross platform applications and or you want to proto type something really really fast but do not want to deal with memory allocation.

    By alienrash April 27, 2001, 07:14 AM

    quote:Originally posted by Pestilence:
    Gish, that IS some very bad programming there. God awful for sure. If I knew the logic behind the programI think I could get it running well. This has kind of become a pet project of mine. Could you post a link to the assignment please?

    It is a game of pick up sticks. You have a series of rows of odd # of sticks. You can pick up as many sticks as you want from any given row. The idea is NOT TO be the person who picks up the last stick, you lose. There are two players, you and the computer.

    The line of sticks may be this:
    1 - I
    2 - III
    3 - IIIII
    4 - IIIIIII

    from line 3 I take 4 sticks:

    1 - I
    2 - III
    3 - I
    4 - IIIIIII

    you take from L2 all:

    1 - I
    3 - I
    4 - IIIIIII

    I take l4 - 6

    1 - I
    2 - I
    3 - I

    Now, no matter what move you make, since you can only kill 1 line @ a time, I have set you up to take the last stick.


    By port22 April 27, 2001, 12:03 PM

    quote:Originally posted by Slovin8:
    This is funny, I'm a sophomore and I have to write a program that solves differential equations in scheme in a week!

    OOOH!
    that does sound fun. What methods are you using? What kind of differentials... I have never done anything in scheme, but I'd love to hear how that works.

    By Slovin8 April 27, 2001, 01:29 PM

    quote:
    OOOH!
    that does sound fun. What methods are you using? What kind of differentials... I have never done anything in scheme, but I'd love to hear how that works.


    Well, the project is not very complex. We should only handle 2nd order homogeneous differential equations given initial conditions. I am implementing it using infinite streams (scaling, referencing, and mapping). We had a previous project in which we solve the Nth derivative and Nth integral but we didn't have to use streams or delayed lists for that. In the beginning of this course while reading the syllabus, I thought they're nuts to teach us that in sophomore level!!

    We were also required to do symbolic differentiation. Again, using recursion and case by case analysis, it wasn't after all very tough. I guess it's not as hard as it seems!

    By Adisharr April 27, 2001, 02:07 PM

    quote:Originally posted by alienrash:

    Yes, people have tried to help. This person has not learned (past occurances) of coming for help hours before it is due.

    The only help then, would have been to write for them. Something many others have done, and yet we still do not learn.

    Crappy code? I've seen and written crappy code. Let alone it compiles, it works. This just takes the cake.

    I have no compasion for a person who cheats their way through life, let alone college and then expects people to take them as legit.

    Well if he succeeds in making a good living being a crappy professional then who is to blame? Him? His Employers? Hard to say..

    Of course he could always go into management

    By Galen of Edgewood April 27, 2001, 02:09 PM

    quote:Originally posted by Adisharr:
    Well if he succeeds in making a good living being a crappy professional then who is to blame? Him? His Employers? Hard to say..

    Of course he could always go into management

    Yup.... Rise to the level of your incompetance!

    By Slovin8 April 30, 2001, 11:40 PM

    On a second note, I drew what I said earlier that the project wasn't tough. I ended up writing a technical report 15 pages long with diagrams, excel datasheets and tables of all kinds. I also had to solve the differential equations analytically and then compare them to the numerical solutions obtained by my program. And then I have to state the deviation between the two methods and the accuracy and any potential flaws.

    This is one of the toughest project I had so far, I don't know why I thought it's going to be easy! It's due in 3 days and I'm not done yet! Gotta go and open some math books.

    By sjelkjd May 01, 2001, 05:06 AM

    alrighty then, let's see how good programmers you guys are.

    Here's a naive implementation of sticks in c++, with a little thinking you guys can beat it.
    (btw, this version is set up so that the person who takes the last stick wins)
    int main()
    {
    int rows[7]={rand numbers...};
    if(eval(7,rows,true))
    cout<<"Player 1 wins"< else
    cout<<"Player 1 loses"< return 0;
    }

    //if turn is true, it's player 1's turn
    bool eval(int num,int* vec,bool turn)
    {

    int i,j,temp;
    //is it empty?
    bool empty=true,result;
    for(i=0;i {
    if(vec[i])
    empty=false;
    }
    if(empty)
    return !turn;

    for(i=0;i {
    for(j=0;j {
    temp=vec[i];
    vec[i]=j;
    result=eval(num,vec,!turn);
    vec[i]=temp;

    if(turn == result)
    {
    return turn;
    }

    }
    }
    return !turn;
    }

    By Slovin8 May 01, 2001, 11:37 PM

    Slovin8 can not function, try after finals.

    By gazuga May 02, 2001, 05:36 PM

    Slovin8: just curios, where do you go to school? Your programming assignments are intriguing. I had a class my freshman year where we used Scheme, but never doing things like Diff Eq. (though we did begin to cover the writing of simple compilers) I thought it was a great class, and I liked Scheme since it was such a departure from the way I normally thought about things (read, C++).

    Anyway, good luck on that assignment...

    By Slovin8 May 02, 2001, 06:38 PM

    quote:
    Slovin8: just curios, where do you go to school? Your programming assignments are intriguing. I had a class my freshman year where we used Scheme, but never doing things like Diff Eq. (though we did begin to cover the writing of simple compilers) I thought it was a great class, and I liked Scheme since it was such a departure from the way I normally thought about things (read, C++).

    Well Gazuga, this is a junior level class (EECS 368) even though I'm a sophomore now. I go to University Of Kansas, Lawrence. I think our university is very underrated, maybe due to the fact we're in Kansas or maybe due to other reasons that I might be aware of. I understand the jump from something like C++ to Scheme I was like why the hell are they teaching us a retraded primitive language?! Well, it's turns out that it is one of the best tools to illustrate functional programming.

    By BarneyInTechno May 06, 2001, 01:43 AM

    i dont get it, was there a question?


    Contact Us | www.SharkyForums.com

    Copyright 1999, 2000 internet.com Corporation. All Rights Reserved.


    Ultimate Bulletin Board 5.46

    previous page
    next page





    Copyright 2002 INT Media Group, Incorporated. All Rights Reserved. About INT Media Group | Press Releases | Privacy Policy | Career Opportunities