# Prime Spiral

2015-05-30, post № 33

mathematics, programming, Pygame, Python, #around, #around the center, #generates, #generator, #gray, #image, #lines, #pattern, #patterns, #prime, #prime generator, #prime lines, #red, #spiral

Being fascinated by prime numbers I wanted to create a prime number spiral generator myself. It just goes through the numbers from 𝟢 to and checks if they are prime. If they are prime, this rectangle in the spiral gets lit red, if it is not prime it gets lit dark gray. Because my algorithm for prime checking is very basic, I implemented a performance helper. That way the spiral’s creation will slow down after time (due to the numbers that need to be checked getting bigger and bigger). The really interesting thing is, that — although they may seem random — prime numbers often form lines if shown in such a spiral. To see the comparison I included an image of a randomly (𝟧𝟢 ％ to 𝟧𝟢 ％) lit up board.

Source code: prime-spiral.py

# Pentecost

2015-05-25, post № 32

art, #animated, #animated gif, #celebrate, #draw, #gif, #Pentecost, #pixel, #pixel art, #pixels, #Whitsun, #Whitsunday, #Whitsuntide

My animated gif regarding Pentecost.

# JClock II

2015-05-24, post № 31

programming, Pygame, Python, #around, #around the center, #background, #center, #change, #changing, #circle, #clock, #clock face, #clock time, #clockface, #clocktime, #count, #current time, #GetCirclePos(), #new, #quantity, #sizes, #time.time(), #visualization

This is an alternative clock design. Version two is even prettier to look at.
Instead of a few clock hands spinning their circles, every hour, minute, second and centisecond is represented as differently colored circles on four imagined circles around the center. That way you have a visualization by quantity, not by position.

This clock face would represent `21:46:42`.

## How to read the clock

• 𝟤𝟣 green circles represents 𝟤𝟣 hours,
• 𝟦𝟨 teal circles represents 𝟦𝟨 minutes,
• 𝟦𝟤 blue circles represents 𝟦𝟤 seconds,
• some white circles represents centiseconds (one hundredth of a second, mainly for the look);
• current time: `21:46:42`.
Source code: jclock-ii.py
Jonathan Frech's blog; built 2021/04/16 21:21:49 CEST