Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 578617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:16:47+00:00 2026-05-13T14:16:47+00:00

I just completed a program that should (hopefully) play a GUI Tetris program. I’ve

  • 0

I just completed a program that should (hopefully) play a GUI Tetris program. I’ve cleaned up all the syntax errors, but now when I double-click, or go through the Command Prompt to run the program a DOS window pops up for less than a second and disappears without ever running the program.

What’s going on?


Heres a link to the code at codepad.org

http://codepad.org/tq4et1rO

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:16:48+00:00Added an answer on May 13, 2026 at 2:16 pm

    Wow, there’s really a huge number of errors in your code. I started running it under pdb, identifying and fixing them one by one, but after 20 or so I gave up. What I fixed so far (in diff‘s output, lines start with < to mean they’re in your version, or with > to mean they’re in my partially fixed version). Note the variety: you often write Flase instead of False, use wrong capitalization, use - (minus) instead of = (equals), misspell variables (e.g. Boardd instead of Board, even instead of event), rnage instead of range, and so on, and so forth.

    37c37
    <       self.isStarted = Flase
    ---
    >       self.isStarted = False
    63c63
    <       self.isWaitingAfterLine - Flase
    ---
    >       self.isWaitingAfterLine = False
    87c87
    <       for i in range(Board.BoardHeight * Board.Boardwidth):
    ---
    >       for i in range(Board.BoardHeight * Board.BoardWidth):
    135c135
    <       if even.GetId() == Boardd.ID_TIMER:
    ---
    >       if event.GetId() == Board.ID_TIMER:
    205c205
    <       self.curY = Board.Height - 1 + self.curPiece.minY()
    ---
    >       self.curY = Board.BoardHeight - 1 + self.curPiece.minY()
    214c214
    <       for i in rnage(4):
    ---
    >       for i in range(4):
    217c217
    <           if x < 0 or x >= Board.BoardWidth or y < 0 or y >= Board.Boardheight:
    ---
    >           if x < 0 or x >= Board.BoardWidth or y < 0 or y >= Board.BoardHeight:
    278c278
    <       self.coords = [[0, 0] for i in rnage(4)]
    ---
    >       self.coords = [[0, 0] for i in range(4)]
    356c356,357
    < Tetris(None, -1, 'Tetris')
    ---
    > tetris = Tetris(None, -1, 'Tetris')
    > app.SetTopWindow(tetris)
    

    After all these fixes, I’ve stopped upon spotting one more typo (you def sqaureHeight when you clearly mean squareHeight) — I have no idea how many typos and other mistakes are still hiding in these 360 lines of code… A density of more such bugs than 1/10th of the lines is plenty high enough for me.

    I heartily recommend that you start with much less ambitious projects and teach yourself to carefully “copyedit” your code for these typos you appear to be so prone to: it’s possible to be dyslexic and an excellent programmer at the same time, but it does take extra effort and diligence on your part. Tools such as pylint may also help a little, although they do have limits.

    Edit: as it turns out, after fixing a couple of occurences of sqaure into square, the program does run — and immediately shows an empty window saying “Game Over” and gets to the raw_input prompt you have as your very last line. So beyond the many typos there must be one or more nasty logic-level bugs as well. I repeat the entreaty to start with something much, much simpler in your first forays into programming.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my just-completed project, I was working getting distributed transactions working. We implemented this
I am responsible for a Delphi/Win32 project management application. I have just completed a
I'm a complete n00b in j3d (but an expert in Java). Just starting out,
I'm completely new to Flex and am just having a play with a sample
Just looking for the first step basic solution here that keeps the honest people
hey there, just practising and I had a question. I have a program (source
The data model in my program has a number of discrete states, but I
I'm just reading Code Complete by Steve McConell and I'm thinking of an Example
Just what the title says, I need to change the password for an existing
just a quick question: I am a CS undergrad and have only had experience

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.