Thread: Compile Problem?

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    1

    Compile Problem?

    Hey all, I'm new to C++ so I thought I'd start out with a fairly basic program..Tetris. If you're not familiar with the game, it's basically polygons falling that you control and try to line up to make a straight line. When they're in a straight line, the line dissolves and you get points.

    The point is, I tried compiling this C++ source to see if it would work and I got a lot of errors...I'm using Dev-Cpp so if someone could try with their compiler and tell me if it works, that'd be great. I just want to know if it's me or the actual code

    Code:
    http://fool.tracerhosting.com/tetris.zip

  2. #2
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    1. We don't know WTF is in those zip files, and some of us won't be too keen to find out.

    1a. Use the free RAR or GZ format, not Zip, for heaven's sake.

    2. Get rid of the deprecated <*.h> headers, like <iostream> and <fstream>.

    3. Your code isn't commented at all. All the people who still wanted to help you give up and wring their hands in sheer frustration.

    4. You're making a laughingstock of yourself:
    This file came from Planet-Source-Code.com...the home millions of lines of source code
    5. I seriously doubt you even wrote the code; the REGS union and the int86() function aren't standard C and don't come with GCC/MinGW/Dev-C++, which you claim to use.

    Away, thief!
    Last edited by jafet; 04-20-2006 at 02:00 AM.
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    For everyone else: Linky

    Quote Originally Posted by T&C
    2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
    Quote Originally Posted by Comments Section
    I got so many errors while compiling with Dev-CPP...?
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > I'm new to C++ so I thought I'd start out with a fairly basic program
    So start with "hello world" like everyone else.

    > I tried compiling this C++ source to see if it would work and I got a lot of errors
    Until you have a really good idea of what's going on, or the code specifically states "compiles with the foo compiler", then the chance of you succeeding at this is about 0%.
    Especially as it seems from other posters that the game in question was written for DOS and you're using a win32 compiler.

    So start a new thread with what you've actually written yourself. This board isn't a dumping ground for people looking for help with compiling god-knows-what-they-found-on-another-site.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 09-14-2008, 02:35 PM
  2. compile problem
    By chintugavali in forum C++ Programming
    Replies: 3
    Last Post: 02-21-2008, 12:16 AM
  3. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  4. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  5. size of Object c++ compile problem
    By micha_mondeli in forum C++ Programming
    Replies: 5
    Last Post: 04-06-2005, 01:20 PM