Code Comments Tutorial: Ink Spill - A "Flood It" Clone

Welcome to the Code Comments Tutorial for Ink Spill. Code Comments is a series of simple games with detailed comments in the source code, so you can see how the game works.

The text in between the triple-double-quotes are comments (technically they are multi-line strings, but Python uses them for multi-line comments). The Python interpreter ignores any text in between them, so we can add any comments about the source code without affecting the program. In general for Code Comments, the comments will describe the lines of code above the comment. It helps to view this file either on the Code Comments site or with a text editor that does "syntax highlighting", so that the comments appear in a separate color and are easier to distinguish from the code.

Click on the colored palettes at the bottom to change the color of the top left box. Any boxes connected to this box with the same color will also have their color changed. The goal of the game is to turn the entire board to a single color before running out of turns.

hey,I'm customer of your book.your book is so great!.i'm closer to finish your book and i'll make the game in The Code Comments Tutorial that you made.and i would like to make 2D-RPG game like final fantasy or any J-rpg,Could you make tutorial to make rpg game and how to save/load the game? or please write the book to making advanced game(like rpg)?.Surely,i will buy that book!! thank you ^^

I am studying python 3 at university for com sci and have found your book and website very useful for understanding my courses. I was wondering why you do not use classes? A number of your programs would be even simpler with classes. An example of this is your gemgem game, truly some awesome and neatly fitting code you have there. Perhaps a class could be used instead of the dictionairies, also maybe a class for colour. I would like to re-write your gem gem code and include some classes, may I have your permission to do so - I will leave all comments as they are.

May I email them to you once I am complete or do you wish me to post it in another comment?

I am aware that you are making it as simple as possible, but I wish to expand my knowledge and perhaps use some advanced concepts, like classes, inheritance as these are part of my first year course.