# Tag Archives: games

## Study a fascinating color illusion in C#

This example shows how you can generate a fascinating color illusion that tricks your brain trick into thinking that a black and white picture is actually colored. All of the pictures shown above are black and white. All except the … Continue reading

Posted in drawing, graphics | | Comments Off on Study a fascinating color illusion in C#

## Gary Beene’s gbUnSnarl game

Check out Gary Bene’s gbUnSnarl game. Your job is to drag the nodes in a network to unsnarl it. Basically it asks you to find a way to rearrange a planar network so none of its edges intersect. Algorithms to … Continue reading

Posted in algorithms, games | | Comments Off on Gary Beene’s gbUnSnarl game

## Color the solutions to the “Find the squares in C#” puzzle

The post Solve the “Find the squares in C#” puzzle explained how you can find solutions to the puzzle described in the post Puzzle: Find the squares in C#. This example shows how you can color the solutions so squares … Continue reading

Posted in algorithms, games, graphics, mathematics | | Comments Off on Color the solutions to the “Find the squares in C#” puzzle

## Solve the “Find the squares in C#” puzzle

This post shows how to solve the puzzle Puzzle: Find the squares in C#. The program howto_square_puzzle_solution uses the following code to define the puzzle’s 11 solutions. // Small squares. Solutions.Add(new int[] { 0, 1, 4, 3 }); Solutions.Add(new int[] … Continue reading

Posted in algorithms, games, mathematics | | 2 Comments

## Puzzle: Find the squares in C#

The example Puzzle: Find the equilateral triangles in C# was fun, at least for me, so here’s another puzzle. This time your goal is find all of the squares that you can make using the red dots shown here. If … Continue reading

Posted in algorithms, games, graphics, mathematics | | 1 Comment

## Solution to puzzle: Zero rows and columns in an array in C#

This post gives four solutions to Puzzle: Zero rows and columns in an array in C#. If you want to try the puzzle for yourself, see that post before you read this one. This is a fairly long post, but … Continue reading

Posted in arrays, games | | 3 Comments

## Puzzle: Zero rows and columns in an array in C#

This puzzle is given as a coding example in the book Cracking the Coding Interview by Gayle Laakmann McDowell. The puzzle is: Write an algorithm such that if an element in an M x N matrix is 0, its entire … Continue reading

Posted in arrays, games | | 1 Comment

## Book Review: Super Scratch Programming Adventure!: Learn to Program By Making Cool Games

Super Scratch Programming Adventure! Learn to Program By Making Cool Games \$24.95, 160 pages, 2012 By the LEAD Project No Starch Press ISBN 13: 978-1593274092 A great, non-threatening introduction to programming This book’s subtitle is, “Learn to program by making … Continue reading

Posted in books, games | | Comments Off on Book Review: Super Scratch Programming Adventure!: Learn to Program By Making Cool Games

## Make silly eyes that track the mouse without flicker in C#

The example Make silly eyes that track the mouse in C# shows how to make eyes track the mouse position, but if you look closely as that program runs you will see a noticeable flicker. The solution is quite simple: … Continue reading

Posted in games, geometry, graphics | | 1 Comment

## Make silly eyes that track the mouse in C#

This example uses a Timer named tmrTick to track the mouse. Its Tick event handler, which is shown in the following code, updates the eyes. // The previous mouse location. private Point OldMousePos = new Point(-1, -1); // See if … Continue reading

Posted in games, geometry, graphics | | 2 Comments