Posts: 419
Threads: 34
Joined: May 2019
def gen_fib(start, length):
fib = [0, start]
for i in range(length):
fib.append(fib[2] + fib[1])
return fib
print(gen_fib(1, 20)) I wrote this sequence generator, but I'm short on ideas of how to interpret this graphically. I want to play with it, see what I can get and hopefully make a puzzle game from what I figure out.
I can use this on the points in a pygame polygons/lines, RGB values... but that's all that comes to mind. I want maybe generate shapes that fit together or something. Don't know. I wrote this function this afternoon, but I haven't really played with it yet.
If I want to make "Fibonacci: The Game", I could use some inspiration for experiments.
Posts: 5,072
Threads: 389
Joined: Sep 2016
2048
A long time ago i did a text game (well more of an animation) of rabbits breeding using the fibonacci sequence to calculate the offspring.
lucas chess fibonacci board
maybe that might spark some ideas
Posts: 147
Threads: 0
Joined: Jan 2021
Mar042021, 03:09 AM
(This post was last modified: Mar042021, 03:09 AM by BashBedlam.)
I don't know if this would be considered inspiration or not but it's kind of fun to play with
import turtle
turtle.speed (11)
def fib_generator (seed, start, length) :
fib = [seed, start]
for i in range (length) :
fib.append (fib[2] + fib[1])
return iter (fib)
for diameter in fib_generator (9, 13, 6) :
for i in range (4) :
turtle.circle (diameter)
turtle.left (91)
turtle.done ()
michael1789 likes this post
Posts: 419
Threads: 34
Joined: May 2019
That chess board is too Menza for me, man. lol.
I have to look into making fractal shapes, then gameify why I learn. You see all those ever expanding patterns... maybe something like that, you make a move and it zooms in/out to draw the next "branch".
Fibonacci alone won't be enough. I need more Mathmaticians; a few more with named formulas. I can use them to control variables in drawing (zoom, rotate, scale, blit off center then scale/rotate, then set_alpha(), etc, ect.
Just brain storming.
metulburr likes this post
Posts: 100
Threads: 0
Joined: Jan 2021
Mar042021, 09:47 AM
(This post was last modified: Mar042021, 09:47 AM by Serafim.)
There is a list of integer sequences on wikipedia, of which a lot are named after the person that found them interesting or important. Some of these sequences are connected to unsolved mathematical problems and som have to do with graph problems. Maybe a source of inspiration.
The Lucas number sequence is closely related to the Fibonacci number sequence.
michael1789 likes this post
Posts: 419
Threads: 34
Joined: May 2019
(Mar042021, 09:47 AM)Serafim Wrote: There is a list of integer sequences on wikipedia, of which a lot are named after the person that found them interesting or important. Some of these sequences are connected to unsolved mathematical problems and som have to do with graph problems. Maybe a source of inspiration.
The Lucas number sequence is closely related to the Fibonacci number sequence.
That's certainly a lot of mathematicians! :) I'll code some sort of drawing loop ala spirograph, plug some of best suited sequences as some of the variables and see what it looks like.
Posts: 419
Threads: 34
Joined: May 2019
(Mar042021, 03:09 AM)BashBedlam Wrote: I don't know if this would be considered inspiration or not but it's kind of fun to play with
Yes it would.
Error: turtle.speed(11)
AttributeError: partially initialized module 'turtle' has no attribute 'speed' (most likely due to a circular import)
How do I fix this? lol. Never touched turtle. np. I'll translate it to pygame and say I wrote it myself. Steal from the best, I say :)
Posts: 419
Threads: 34
Joined: May 2019
I'm coming closer to how to visualize this stuff.
I'll add dimensions one at a time, but the current plan is to generate repeating expanding pattern(fractal) of points. When I like that, I'll add/subtract points as needed, and draw polygons with them. Then figure out 3d and how to texture map translucent glass texture.
If I can't make a game out off that... lol
Posts: 100
Threads: 0
Joined: Jan 2021
(Mar042021, 04:03 PM)michael1789 Wrote: That's certainly a lot of mathematicians! :) I'll code some sort of drawing loop ala spirograph, plug some of best suited sequences as some of the variables and see what it looks like. Quite far down on the Fibonacci page on wikipedia you have some interesting generalizations, starting with " Tribonacci_numbers". From there and down the page there is a lot of funny examples. And if you take a look at the corresponding OEIS pages there are loads of comments that also may generate ideas.
Posts: 419
Threads: 34
Joined: May 2019
It's a start!
def gen_fib(start, length):
fib = [0, start]
for i in range(length):
fib.append(fib[2] + fib[1])
return fib
class Fractal():
def __init__(self, game, pos):
self.nodes = [vec(pos)]
def update(self):
dir = vec(random.randrange(2, 2), random.randrange(2, 2))
for i in gen_fib(1, 5):
self.nodes.append((self.nodes[1] + (i * dir)))
