10 votes

N dimensional cubes

Generation of vertices You could use itertools.product to generate vertices. You can ...
  • 28.7k
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,...
  • 52.9k
8 votes

ASCII Turtle Graphics

Way too many comments. They should teach proper use of comments in school, instead of just saying "put comments everywhere!". Good comments should say why. Comments that say what simply shouldn't ...
8 votes

Math, Geometry, & Physics Library

There are a few things that stick out to me Omer: You should learn the more advanced usage of the print statement (and potentially begin using the ...
7 votes
Accepted

Drawing a gnome in Logo

Readability would be greatly enhanced by splitting the code into stanzas, using more line breaks, and adding comments. Why do you like drawing backwards? Going forward is much easier to understand. ...
7 votes

Math, Geometry, & Physics Library

This library does a lot of different, mostly unrelated things. I would consider breaking it up into at least two different libraries. Math and ...
  • 30.7k
7 votes
Accepted

Random walk in Python + turtle

Your code looks nice and seems to be fully PEP 8 compliant indeed. The fact that you have 1 blank line between functions except in one place where you have 2 puzzles me a bit but that's not a huge ...
  • 28.7k
7 votes

Python Trig Calculator

Just general style What the other comment said is true, the style can be improved here. meaningful names (Calling arguments arg is not so helpful :) For the ...
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 &...
6 votes

Python Trig Calculator

A few pointers: Use meaningful variable, function and method names. dass(self, arg, arg1, arg2, ans, args, args1, args2): gives me no information about what ...
  • 13.8k
6 votes
Accepted

ASCII Turtle Graphics

You should be using the Command pattern instead of having methods for each command type. This will give you separation of concerns, undo/redo functionality, and a cleaner separation of code. You'll ...
  • 6,396
6 votes

Koch snowflake in Python with Turtle

Your code reads well and is easily understandable. On top of also finding that you might have too much constant (more on that in a little bit), I just have a few nitpicks: whitespace in expressions ...
6 votes

Drawing a gnome in Logo

I think the only thing I do not remember the reason for is the repeats of 'pu pd' but I think it was to ensure that the pen is up. Indeed, ...
6 votes

Simple labyrinth

I would highly recommend that you read PEP 8, the Python style guide. There are a couple rules you are breaking. From the Imports section: Wildcard imports (...
  • 3,767
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: ...
  • 1,341
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 ...
  • 52.9k
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 ...
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 ...
  • 109k
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 ...
  • 12.8k
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 ...
  • 17.1k
4 votes

Drawing fractals with Turtle

For each shape, you have this kind of code to generate the movement "recipe": ...
  • 109k
4 votes
Accepted

Python Turtle screen saver

draw_turtle_screensaver() is rather tedious, with many variables and some repetitive code. For example, you have red, ...
4 votes

Random walk in Python + turtle

I think that you can simplify the simulation like this without losing any clarity: ...
4 votes

Random walk in Python + turtle

All of the go_* functions are implemented with the same code. The only difference is the value passed to setheading(). You could ...
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 <...
4 votes
Accepted

Sierpinski turtle triangle

Nice. I only have three comments. In draw_polygon() use a for loop rather than an explicit counter: ...
  • 9,380
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 ...
  • 3,816
3 votes
Accepted

Memory game with Turtle

All I'm asking for is your overall opinion of how it was done and how it works. Not good. Your code breaks almost any rule generally agreed about good code. But don't be sad, you are lucky because ...
  • 27.3k
3 votes
Accepted

Small turtle program using instruction strings to draw patterns

I like the concept of the question (using a domain-specific language to specify a fractal) and your implementation. An object-oriented rewrite could make it better, but it's not bad as it is. ...

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