# Sailing

2015-11-15, post № 82

**art**, #beach, #boat, #ocean, #pixel, #pixel guy, #sea, #ship, #water

The little pixel guy wants to cross the water. He comes up with a good idea!

2015-11-15, post № 82

**art**, #beach, #boat, #ocean, #pixel, #pixel guy, #sea, #ship, #water

The little pixel guy wants to cross the water. He comes up with a good idea!

2015-11-14, post № 81

**programming**, **Pygame**, **Python**, #clock, #composite, #composite number, #factorization, #prime, #prime factorization, #prime time, #primes

This alternative clock is not really readable by human. It calculates the first 𝟣𝟦𝟦^{ [1]} primes, assigns 𝟨𝟢 of them to every possible second, 𝟨𝟢 to every possible minute and 𝟤𝟦 to every possible hour.

Multiplying those three primes for a given time results in a composite number representing said time. Using integer factorization, you then can get the three primes back, map them to seconds, minutes and hours, and by doing so calculate the time.

Extra assets: jclock-vii_extra.gif

2015-11-08, post № 80

**programming**, **Pygame**, **Python**, #clock, #clockface, #simple, #time

This clock uses a simple clock design with the standard clock face. Red, green and blue represent second, minute and hour.

Source code: jclock-vi.py

2015-11-07, post № 79

**mathematics**, **programming**, **Pygame**, **Python**, #%, #black, #mod, #modulo, #red

This program calculates primes, takes their remainder^{ [1]} and then places a color accordingly. The shapes are quiet interesting.^{ [2]}

- ‘Space’ takes a screenshot.

Source code: prime-remainders.py

2015-11-01, post № 78

**mathematics**, **programming**, **Pygame**, **Python**, #ant, #black, #black and white, #crawling, #highway, #Langton, #white

This program is a simulation of Langton’s Ant. The following image shows the ant on its highway.

- ‘F1’ takes a screenshot,
- ‘Space’ stops and resumes the ant’s movement.

Source code: langtons-ant.py

2015-10-31, post № 77

**art**, #animated, #animated gif, #animation, #gif, #Halloween, #pixel, #pumpkin, #scary, #spooky

This gif is dedicated to the year’s scariest date, Halloween.

2015-10-25, post № 76

**programming**, **Pygame**, **Python**, #around the center, #black, #black hole, #emission, #galaxy, #particles, #red, #Slow Mo Guys, #slow motion, #spin, #spinning

Inspired by a recent Slow Mo Guys video, I wrote a simulation for the shown effect. I think it looks pretty neat…

- Up arrow increases the number of emitted particles,
- Down arrow decreases the number of emitted particles,
- ‘Space’ saves a screenshot.

Source code: spiral.py

2015-10-24, post № 75

**mathematics**, **programming**, **Python**, #(1+1/n)^n, #approx., #approximation, #constant, #e, #Euler

By using the formula for a big number 𝑛, you can approximate the mathematical constant 𝑒.

Source code: e-generator.py

2015-10-18, post № 74

**games**, **programming**, **Pygame**, **Python**, #acceleration, #c't, #car, #mouse, #mouse controlled, #position, #race, #ractrack, #track, #vector, #velocity, #vertrac't

In a recent c’t article^{ [1]} they showed a game regarding vector mathematics, velocities, accelerations and positions.

I could not resist and wrote this program to simulate the game.

The only thing this program cannot do is to check the barriers. That you have to check for yourself.

You have a start position (red), an end position (green) and some barriers (white).

Your job is it to steer your little dot (bright yellow) onto the end position.

To make it more difficult, you are not allowed to change the dot’s position directly, but rather you accelerate it on each step.

Your acceleration vector (turquoise) also is not allowed to be longer than 𝟣𝟢 (dim yellow bubble) and at the end point your dot must have a velocity of (𝟢, 𝟢).

The fewer moves you need, the better your steering abilities.

- Mouse movement changes the new acceleration vector applied in the next step,
- Left click moves one step,
- Right click is a undo for the latest move,
- Middle click moves the frame,
- ‘c’ clears all the moves made so far,
- ‘e’ exports current moves to a
`.txt`

file, - ‘Space’ saves a screenshot.

Source code: ct-racetrack.py

Extra assets: ct-racetrack-0.png, ct-racetrack-1.png, ct-racetrack-3.png, ct-racetrack-4.png, ct-racetrack-6.png, ct-racetrack-7.png, ct-racetrack-8.png, ct-racetrack-9.png, ct-racetrack_moves-0.txt, ct-racetrack_moves-1.txt, ct-racetrack_moves-2.txt, ct-racetrack_moves-3.txt, ct-racetrack_moves-4.txt, ct-racetrack_moves-5.txt, ct-racetrack_moves-6.txt, ct-racetrack_moves-7.txt, ct-racetrack_moves-8.txt, ct-racetrack_moves-9.txt, ct-racetrack_moves-10.txt, ct-racetrack_moves-11.txt, ct-racetrack_solution-1.txt, ct-racetrack_solution-2.txt

2015-10-17, post № 73

**programming**, **Pygame**, **Python**, #black, #glow, #mouse, #mouse controlled, #pixels, #red, #specs, #spread, #vector, #vector maths

Tinkering around with vectors, I created this fancy program. By left-clicking you spawn a white circle at your current mouse position. This circle then will emit a specific quantity of red pixels (which is 𝑐 = 𝟤 𝜋 𝑟 with 𝑟 = 𝟧𝟢). Those red pixels then get pushed across the screen until they eventually die out.

- Left click spawns in a circle,
- ‘Space’ saves a screenshot.

Source code: flare.py

2015-10-11, post № 72

**programming**, **Pygame**, **Python**, #3-gon, #background, #gradient, #triangles, #vector, #vector mathematics, #vectors, #wallpaper

This program uses vector mathematics and colors to create triangular gradient. By simply left-clicking you create three points which then will be filled in with color.

- Left click adds a new position,
- ‘Space’ saves a screenshot.

Source code: gradient-triangles.py

Extra assets: gradient-triangles-3.png