Skip to content

Instantly share code, notes, and snippets.

View 99991's full-sized avatar

Thomas Germer 99991

  • HHU Düsseldorf
  • Düsseldorf
View GitHub Profile
@99991
99991 / hex_grid.py
Created March 2, 2020 19:57
A python code snippet to generate a hexagonal svg grid
import math
class Line:
def __init__(self, x1, y1, x2, y2):
self.x1 = x1
self.y1 = y1
self.x2 = x2
self.y2 = y2
def to_svg(self, style):
@99991
99991 / tictactoe.c
Created November 5, 2018 22:28
Play tic-tac-toe with random moves very fast
// Sample output:
//
// Win probability for first move with random agents:
// 0.115 0.102 0.116
// 0.102 0.131 0.101
// 0.116 0.102 0.116
// Player 1 won 584650 times
// Player 2 won 288379 times
// 126971 ties
// 0.035250 seconds