Skip to content
{{ message }}

Instantly share code, notes, and snippets.

# Paweł Samoraj samorajp

Last active Oct 22, 2020
download and import linalg
View template.txt
 !wget -N https://raw.githubusercontent.com/anagorko/linalg/main/linalg.py import linalg
Created Feb 27, 2016
Wizualizacja w PyGame do programu https://gist.github.com/samorajp/a182fb22eb59fe89b620
View pygame_vis.py
 # encoding: utf-8 import pygame from pygame.draw import circle, line from pygame.locals import * import misjonarze # Initialize the game engine pygame.init() # Constants
Created Feb 27, 2016
Program rozwiązujący zagadkę o misjonarzach i kanibalach dla ich dowolnej liczby oraz dowolnej pojemności łódki.
View misjonarze.py
 def mutations(state, boat_size): m_left, k_left, boat, m_right, k_right = state sign, other_side = (-1, "R") if boat == "L" else (1, "L") naive_mutations = [ (m_left + sign * m_diff, k_left + sign * k_diff, other_side, m_right - sign * m_diff, k_right - sign * k_diff) for m_diff in range(boat_size + 1) for k_diff in range(boat_size + 1)
Created Oct 2, 2015
linear regression
View gradient.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.