Skip to content

Instantly share code, notes, and snippets.

View Nircek's full-sized avatar

Marcin Zepp Nircek

View GitHub Profile
@Nircek
Nircek / 1procedura wyboru marszałka.md
Last active March 5, 2018 20:51
Procedura wyboru marszałka

Procedura wyboru marszałka

Do momentu zakończenia procedury tymczasowym marszałkiem jest gospodarz lub, jeżeli takowego trudno określić, zwoływacz spotkania. Wykonywane są następujące kroki zgodnie z kolejnością:

  1. wybierany jest najstarszy z zebranej grupy, który posiada pod ręką kostkę, nazywamy go później Rzucającym
  2. Rzucający liczy zebrane osoby, a następnie wybiera, jaka jest używana wersja:
    1. Modulo
    2. Equals
  3. według kolejności wieku (od najmłodszego) po kolei każda osoba wybiera liczbę z zakresu od 1 do ilości ludzi w grupie, przy czym nie mogą się one powtarzać
  4. ustawić s jako ilość ścian na kostce
  5. ustawić o jako ilość osób w grupie
@Nircek
Nircek / cypher.py
Last active March 11, 2018 18:52
Szyfrująca
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# code from Nircek's gist "Szyfrująca" https://gist.github.com/Nircek/9b4df55d89fa040c2eabb81b2060db2f
# licensed under MIT license
# MIT License
# Copyright (c) 2018 Nircek
# Permission is hereby granted, free of charge, to any person obtaining a copy
@Nircek
Nircek / SZrfc11.txt
Last active April 3, 2018 20:37
Traktat ulamsko-ułamski
SZ ŚI Working Group Nircek ; https://github.com/Nircek
Request for Comments: 2π√3 1 April 2018 ; https://en.wikipedia.org/wiki/April_Fools%27_Day
Category: Informational
Obsoletes: 2324 ; https://www.ietf.org/rfc/rfc2324.txt
Traktat ulamsko-ułamski
Status of this Memo
@Nircek
Nircek / getHpString.cpp
Last active April 17, 2018 18:37
Wycieniowany pasek zdrowia w konsoli.
#include <iostream>
#include <sstream>
using namespace std;
typedef unsigned int uint;
string getPasekString(uint hp, uint maxhp, uint size=10, bool multi=true){
string ret = "";
if(maxhp<hp)hp=maxhp;
@Nircek
Nircek / modulos.py
Last active July 23, 2018 13:29
skrypt napisany pod wpływem inspiracji programem kolegi osoby o inicjałach MCh
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# MIT License
# Copyright (c) 2018 Nircek
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@Nircek
Nircek / pi.py
Created July 31, 2018 14:05
Script for calculating pi value
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# MIT License
# Copyright (c) 2018 Nircek
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@Nircek
Nircek / dlaMichałka.cpp
Created August 9, 2018 12:48
program do interpretowania komend (ćwiczenie obsługi stringstream)
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
stringstream sss[8], cmd;
string scmd, escmd;
int in=0, out=0;
@Nircek
Nircek / getch.cpp
Created September 16, 2018 14:55
portable (for Windows and Linux) getch() function
/*
MIT License
Copyright (c) 2018 Nircek
Permission is hereby granted free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
#!/usr/bin/python3
from random import random
from sys import argv
class Map:
def __init__(self,W,H):
self.W=W
self.H=H
self.X = -1
self.Y = -1
self.m = []
@Nircek
Nircek / mazes.py
Last active September 24, 2018 15:12
A script for generating mazes
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# from https://gist.github.com/Nircek/7e1ee37e0bbc30f7ab554c633209a8d4/
from random import random
from os import system, name
# ----| code from https://github.com/Nircek/minesweeper-solver/blob/master/getch.py
# inspired by http://code.activestate.com/recipes/134892/
try:
import msvcrt
getch = msvcrt.getch