Skip to main content
10 votes

N dimensional cubes

Generation of vertices You could use itertools.product to generate vertices. You can ...
SylvainD's user avatar
  • 29.3k
10 votes

Simple (Very Easy to Make) RPG Game Simulation in Python and Turtle

jedi_gif = "/home/asus/Arief_tempo/images/random/jedi.gif" It's unclear why this image has an absolute path but no others do. They should probably all be relative,...
Reinderien's user avatar
  • 65.6k
7 votes
Accepted

Drawing dragon curves using Turtle graphics

Whitespace There should be a blank line between two method definitions. Also, some blank lines inside of the methods would give the code room to breathe, and allow you to visually separate individual &...
Jörg W Mittag's user avatar
7 votes

Drawing a mathematical envelope with turtle graphics

Overview You've done an excellent job: Overall code layout is good You did a good job partitioning code into functions You leveraged code written by others with the imports Used meaningful names for ...
toolic's user avatar
  • 6,312
7 votes
Accepted

Drawing a mathematical envelope with turtle graphics

It's good that you got this working (especially since you only started a week ago). It's also unsurprising that you're using turtle, which is geared toward beginner graphics. As you've already seen, ...
Reinderien's user avatar
  • 65.6k
6 votes

Simple (Very Easy to Make) RPG Game Simulation in Python and Turtle

Just a note of something that was particularly jarring when viewing your code; for stylistic reasons, you shouldn't have spaces on either side of the arguments: ...
Graham's user avatar
  • 1,379
6 votes

Python analog clock with turtle - runs slow

Avoid import *; there's only a few symbols you need from turtle. There's a lot of repetition in your hand logic. Consider factoring out a class that does the common ...
Reinderien's user avatar
  • 65.6k
5 votes

Python OOP Whac-A-Mole program using turtle

Terminology one [class] for Game which is the super class What you probably mean is that it is the class that controls everything and such is on top of the logical class hierarchy. But when ...
Raimund Krämer's user avatar
5 votes
Accepted

Basic Ray Tracer

Overview You've done an excellent job: Overall code layout is good You did a good job partitioning code into functions You leveraged code written by others with the imports Used meaningful names for ...
toolic's user avatar
  • 6,312
4 votes
Accepted

Python Turtle - Olympic flag re-creation

Your function kind-of works as intended, except the obvious deviation occurring at the crossings of rings. However, you can only draw the logo at one specific size and you need a heck of a lot of code ...
Mast's user avatar
  • 13.5k
4 votes
Accepted

Drawing fractals with Turtle

Couple performance and code style related notes: if you can define something outside/before a loop, do so. For example, there is no need to define linSys inside ...
alecxe's user avatar
  • 17.3k
4 votes

Drawing fractals with Turtle

For each shape, you have this kind of code to generate the movement "recipe": ...
janos's user avatar
  • 112k
4 votes

Python Checkers

Performance This is very inefficient: def onGrid(x,y): if((x in range(8)) and (y in range(8))): return True else: return False The ...
janos's user avatar
  • 112k
4 votes
Accepted

Python - Random Mandala

I don't know why you would want to shorten your code. It is already just 73 lines long (including the final blank line). Apart from that, "short" does not automatically mean "good". Maybe concise ...
AlexV's user avatar
  • 7,278
4 votes
Accepted

Draw checker board

In essence, the code is well designed. You’ve split the code into simple, reusable functions and the logic is clear. But there are still improvements to be made: You relly on the global variable <...
301_Moved_Permanently's user avatar
4 votes

Sierpinski turtle triangle

I'm a python beginner,so at the moment I can only see that you can slightly improve your code using range in the function draw_polygon, so instead of ...
dariosicily's user avatar
  • 3,971
4 votes
Accepted

Sierpinski turtle triangle

Nice. I only have three comments. In draw_polygon() use a for loop rather than an explicit counter: ...
RootTwo's user avatar
  • 10.2k
3 votes

Symmetries of Triangle Python Turtle

Starting at the bottom of the code: You don't have an if __name__ == '__main__': block. Unless things have changed in Python 3, you really ought to have one. (This ...
Quuxplusone's user avatar
  • 19.4k
3 votes
Accepted

Python Pong using turtle

The major issues I see with your code are: Use of while True: in an event driven environment. We need to put the ball on a timer event instead. The angle of ...
cdlane's user avatar
  • 176
3 votes

Python Turtle based Pong game

First - You have numeric constants scattered all over the code. Try to change the board width to 500 and you will immediately understand. Numeric constants like board width shall appear exactly once ...
stefan's user avatar
  • 2,980
3 votes
Accepted

Python Beginner - Basic Hangman Game Using Turtle

Relative file paths WORDLIST_FILENAME = "E:/My Documents/Programming/Projects/Hangman/words.txt" should be modified so that it's relative. The easy thing ...
Reinderien's user avatar
  • 65.6k
3 votes

Python analog clock with turtle - runs slow

I found the correct way to optimize your code: the drawing code takes some time, so you should not wait 1 full second, but only wait until the time elapsed from the start of the loop is one second: <...
Caridorc's user avatar
  • 27.6k
3 votes
Accepted

Turtle language parser in python 3

The code is pretty small and straight-forward, I mainly see minor improvements. I find it somewhat strange that parse_file() is what calls on the main function, and ...
ades's user avatar
  • 1,271
2 votes

Python Turtle based Pong game

Okay, thanks for fixing up the code. Now, to make it more pythonic, we need to move all the statements (not functions) into the entry point, which is a ...
C. Harley's user avatar
  • 1,533
2 votes
Accepted

Blackjack in Python (using Turtle)

There's good news and bad news. For beginner code, this is fairly well written. The graphics are intuitive and the controls straightforward. However, the site you've used (trinket.io) allows a kind ...
Mast's user avatar
  • 13.5k
2 votes

Python the Dragon's Curve with turtle

Here are some suggestions and remarks, in no particular order: i is not a great name for a variable in most cases, and especially not when it's not short for "...
rreillo's user avatar
  • 1,098
2 votes
Accepted

Turtle controller with simple instruction set

Classes (and functions) should ideally do one thing and do it well. The Python Zen also stipulates "There should be one-- and preferably only one --obvious way to do it." Your class goes against this ...
Graipher's user avatar
  • 41.1k
2 votes

Sierpinski turtle triangle

Good luck in your learning, very nice start, i was much poorer in my begining! Viewing your code i suggest a structural change besides what @RootTwo and @dariosicily told. The Spirit of Functions ...
Abdur-Rahmaan Janhangeer's user avatar
2 votes

Simple (Very Easy to Make) RPG Game Simulation in Python and Turtle

One guiding principle in programming is to write DRY code, Don't Repeat Yourself. Your JediLuke class and your Orc class are ...
Graipher's user avatar
  • 41.1k
2 votes
Accepted

Symmetries of Triangle Python Turtle

I'm not an experienced user of either tkinter not turtle graphics, so I can't offer specific improvements with regards to those. I can offer some general Python advice though. I like the Label class ...
spyr03's user avatar
  • 3,032

Only top scored, non community-wiki answers of a minimum length are eligible