October 26th, 2021 October 26th, 2021
Already Tuesday?! Weeks sure go by fast...


Just like yesterday, I was programming, and it was as fun as usual. Here is a piece of code I wrote:

from turtle import *
from random import randint
for i in range(100000):
  slumpat_tal = randint(10000000000000,100000000000000000000000000000000000)
speed(slumpat_tal)
def draw_star():
 for i in range(5):
  forward(50)
  left(144)
for i in range(500):
  num_stars=0
  while num_stars < 500:
    x = randint(-200, 200)
    y = randint(-200, 200)
    draw_star()
    penup()
    goto(x,y)
    pendown()
    num_stars=num_stars+1
    print(x,y)
    print(num_stars)

What it does, is that it draws a bunch of stars in random location, and the location and the variable called "num_stars" is printed in the console. I tried running it for the entire lesson (45 minutes), and the turtle graphics window became almost entirely black. It was not me who wrote the entire code, I got a lot of it from matematikxyz.com, but I modified it a lot, and made it draw a lot more stars, more specifically 5002, and that's a little bit more than five.
The religion test I had today, went well, as expected. It was easy, but a little difficult, even for someone who studied a little more than ten minutes the night before.
I really like programming, so I programmed a lot when I came home. My brother, who studies at a swedish university, told me how to calculate fractal numbers, in python. Because python does not have a built-in funcion for that he had to write an algoritm than calculated them. This is how it looks like:
import random
for i in range(1000):
  def f(n):
    if n == 1:
      return 1
    else:
      return n*f(n-1)
print(f([INSERT NUMBER HERE]))

I tried putting in numbers higher than 69!, which is the highest possible fractal number a standard pocket calculator can calculate. It could calculate numbers as high as 998!, which is even higher than a googol, which is 10100.
I also played chess when I was home, and someone in my class, told me that it's possible to change difficulty level on chess.com, which I had no idea was possible. I tried the hardest level, and it was waaaaay easier than I thought. It was not like when jschlatt lost a chess game in two moves, I did lose, but it took like twenty, or thirty moves.
Back to the journal index for 2021
Back to the journal index page
Last updated: 20211026 22:29