2015-07-19, post № 48

**programming**, **Pygame**, **Python**, #around the center, #black, #black and white, #circle, #curcular, #generates, #generator, #getCirclePos(), #gray, #prime, #primes, #spinning, #spiral

My first attempt at making a prime spiral worked, but it worked with 𝟫𝟢° angles. Trying to make it look smoother, I now used an angle and a distance, drawing circles at calculated position.

If the number is prime, it gets white. If it is not, the circle will be gray.

2015-07-18, post № 47

**mathematics**, **programming**, **Pygame**, **Python**, #3, #3-gon, #around the center, #black, #black and white, #fractal, #generates, #generating, #generator, #three, #triangle, #white

Having recently heard something about chaos theory, I was interested in the Sierpiński triangle. Specifically in the random generation. To prove that it can really be generated using a die, I wrote this program.

## How it works

- You start with any point inside the triangle (I chose the center).
- A triangle has three points, let us call them 𝐴, 𝐵 and 𝐶.
- You choose randomly between one of those three points, go half the distance and set a pixel right there.
- Repeating this process over and over again (always starting at your last point), you eventually get the Sierpiński triangle.

## Controls

- ‘Space’ toggles if the triangle is generated,
- ‘m’ toggles if the current position is shown (indicated by a blue circle).

2015-07-12, post № 46

**games**, **programming**, **Pygame**, **Python**, #AI, #algorithm, #blue, #com, #computer, #pixel, #pixel graphics, #tac, #tic, #tic-tac-toe, #tictactoe, #toe, #TTT

As the name suggests, this is a computer version of the well-known game Tic-Tac-Toe. This version supports a computer player, but it is not the smartest algorithm and can lose. In this setup, the computer plays ‘O’ and starts, the player plays ‘X’.

Win detection is fully implemented.

## Controls

- The 𝟥 ⨉ 𝟥-field is projected on the numpad, so
`7`

sets your piece in the upper left corner and `3`

puts it in the lower right corner. - Escape resets the game.

Posts:

243-241, 240-238, 237-235, 234-232, 231-229, 228-226, 225-223, 222-220, 219-217, 216-214, 213-211, 210-208, 207-205, 204-202, 201-199, 198-196, 195-193, 192-190, 189-187, 186-184, 183-181, 180-178, 177-175, 174-172, 171-169, 168-166, 165-163, 162-160, 159-157, 156-154, 153-151, 150-148, 147-145, 144-142, 141-139, 138-136, 135-133, 132-130, 129-127, 126-124, 123-121, 120-118, 117-115, 114-112, 111-109, 108-106, 105-103, 102-100, 99-97, 96-94, 93-91, 90-88, 87-85, 84-82, 81-79, 78-76, 75-73, 72-70, 69-67, 66-64, 63-61, 60-58, 57-55, 54-52, 51-49, **48-46**, 45-43, 42-40, 39-37, 36-34, 33-31, 30-28, 27-25, 24-22, 21-19, 18-16, 15-13, 12-10, 9-7, 6-4, 3-1Jonathan Frech's blog; built 2021/04/16 21:21:49 CEST