Homework:

Problem X1:

Write program which simulates Conway's Game of Life
https://en.wikipedia.org/wiki/Conway's_Game_of_Life#Rules

Write a program which simulates the game on a field of cells sized NxN (make a variable at the start of your program)

You can use numpy.

Visualize the game by printing on terminal X - for populated cell, O for empty.
Assume, that outside the game gorders all cells are empty.
Starting field should be randomly generated

Problem X2

Expand your Game of Life.

Your program now should accept parameters:

python3 life.py 10 starting_field.pgm finished_field.pgm

where 10 is a number of simulation steps to simulate.
starting_field.pgm - is a name of pgm formatted file where starting field is defined
finished_field.pgm - is a pgm file with result of 10 simulation steps

additionally:

When program is run like this:
python3 life.py 10 plansza_końcowa.pgm

You should create random game field sized 100x100, du 10 simulation steps and write result into plansza_końcowa.pgm

PLEASE NOTE: Assume that in PGM black pixels are populated and white are free.

Problem X3
Write a program which would read text file formatted like this:


Maria Konopnikca 5552225
Ala Bohda 5552155
Jerzy Kiery 32325986

Which is a phone book. Ask user for action (using input() ) and implement these functions:

sorting by name - should print all records sorted alphabetically using names
sorting by surname - should print all records sorted alphabetically using names
searching for text in names and surnames - should print only those records which contain user-provided string in name or surname (Igore the CaSinG)

Bonus mode: your search should try to ignore polish diacritcs (example: record "Łukasz Kac 546464" should be printed when user searches for name "Lukasz")

Problem X4

Write a password gnerator.
It should have 2 modes - easy to remember or hard.

Easy to rmember should generate pronouncable words - some string of alternating vowels and consonant letters, length of 7-10 (randomly selected)
Hard to remember should generate passwords using letters, numbers and punctuation marks. (7-10 characters, randomly selected)

Zadanie X5

Write a game of Tic-Tac-Toe for 2 player. Game field should be visualized like this:
https://en.wikipedia.org/wiki/Tic-tac-toe

   |   |
 1 | 2 | 3 
   |   |
---+---+---
   |   |
 4 | 5 | O
   |   |
---+---+---
   |   |   
 7 | X | 9
   |   |
   
Player 1 (kółko), please enter number of the field to use:
>>>
Game should ask players for their turns and detect winning condition.


Zadanie X6
Data to copy into your progam: 


data = '███╗   ███╗███████╗██████╗ ██████╗ ██╗   ██╗    ██╗  ██╗███╗   ███╗ █████╗ ███████╗\n████╗ ████║██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝    ╚██╗██╔╝████╗ ████║██╔══██╗██╔════╝\n██╔████╔██║█████╗  ██████╔╝██████╔╝ ╚████╔╝      ╚███╔╝ ██╔████╔██║███████║███████╗\n██║╚██╔╝██║██╔══╝  ██╔══██╗██╔══██╗  ╚██╔╝       ██╔██╗ ██║╚██╔╝██║██╔══██║╚════██║\n██║ ╚═╝ ██║███████╗██║  ██║██║  ██║   ██║       ██╔╝ ██╗██║ ╚═╝ ██║██║  ██║███████║\n╚═╝     ╚═╝╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝       ╚═╝  ╚═╝╚═╝     ╚═╝╚═╝  ╚═╝╚══════╝\n                                                                                   '
Using numpy generate an animation of this text block - it should wave vawe vertically (like OCEAN logo here, only vertially, not horizontally https://youtu.be/Q8UJQB-bNaU?t=7 )

You should use numpy to create an array from this "data" text block. You can animate the text by printing it, doing time.sleep(1/60) and printing new, changed text.

Hints:
numpy.roll - moves an array in some axis by n elements
You can generate moving sinusoid - it could provide you with displacement offset for every column
It would be usefull to write a function which copies an array and then moves its columns up or down using some array with displacement values.
I recomend storing "data" in an array bigger than needed - so it would have some room for waving

Zadanie X7

Read file 'EKG.txt', it has electro cardiogram recoding. Every poing is voltage in microvolts measured every 10 ms (100 times per second)

Write a program which finds heartbeats and calculates heartrate (beats per minute)
hint:
import pylab as pb
pb.figure()
pb.plot(list_of_numbers)
pb.figure()
pb.plot(another_list_of_numbers)
pb.show()
hint 2:
Heartbeats can be recognised using amplitude - it should be enough to calculate how many times signal crosses some value (you should try to find the treshold automatically)