Ask coding questions

← Back to all posts
Tetris error
CodeKeeper (5)

Hey guys!
I was wondering if anyone would review my code and see what the error is... I don't understand what there is that I can't seem to fix. This would be a great help!
Thanks

Answered by Coder100 (18939) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (18939)

here is your error, you added an extra x!
correct code:

def new_board():
	board = [ [ 0 for x in range(config['cols']) ]
			for y in range(config['rows']) ]
	board += [[ 1 for x in range(config['cols'])]]
	return board
CodeKeeper (5)

@Coder100 From your permission may I use this code???

Coder100 (18939)

when you ask for help usually the helpers give you permission to use their solutions!!

In other words, of course!

Also np :) @CodeKeeper

CodeKeeper (5)

@Coder100 THANKS!!! Please tell me what service I may do to you. I would love to help you! I also just realized you are a cc! First time I think I am getting a response and help from a cc!

Coder100 (18939)

what is a cc?

Also np :)
btw mark as correct answer so others can see this as resolved
@CodeKeeper

CodeKeeper (5)

@Coder100
A cc is content creator!

Bluelight4251 (11)

You did a xrange. It's range. on line #92.