diff --git a/README.md b/README.md
index f75f857f..c3472373 100644
--- a/README.md
+++ b/README.md
@@ -1,49 +1,97 @@
-# Podstawy C++ #1
-
-## [Moduł 1](module1/)
+# Podstawy C++
+
+## [Moduł 1](module1/index.pl.html)
+
+### [Typy](module1/01_types.pl.md)
+
+### [Funkcje](module1/02_functions.pl.md)
+
+### [Instrukcje warunkowe](module1/03_branches.pl.md)
+
+### [Pętle](module1/04_loops.pl.md)
+
+### [Tablice](module1/05_arrays.pl.md)
+
+### [Praca domowa](module1/06_homework.pl.md)
+
+## [Moduł 2](module2/index.pl.html)
+
+### [STL](module2/01_stl_intro.pl.md)
+
+### [`std::vector`](module2/02_vector.pl.md)
+
+### [`for` po kolekcji](module2/03_range_for.pl.md)
+
+### [`std::string`](module2/04_string.pl.md)
+
+### [`std::list`](module2/05_list.pl.md)
+
+### [`std::map`](module2/06_map.pl.md)
+
+### [Praca domowa](module2/07_homework.pl.md)
+
+## [Moduł 3](module3/index.pl.html)
+
+### [Zasięg zmiennych](module3/01_scopes.pl.md)
+
+### [Referencje](module3/02_references.pl.md)
+
+### [Wskaźniki](module3/03_pointers.pl.md)
+
+### [Zagrożenia](module3/04_hazards.pl.md)
+
+### [`enum` i `enum class`](module3/05_enums.pl.md)
+
+### [Praca domowa](module3/07_homework.pl.md)
+
+___
+
+# C++ basics
+
+## [Module 1](module1/index.en.html)
-### [Typy](module1/presentation_types.md)
+### [Types](module1/01_types.en.md)
-### [Funkcje](module1/presentation_functions.md)
+### [Functions](module1/02_functions.en.md)
-### [Instrukcje warunkowe](module1/presentation_branches.md)
+### [Conditional statements](module1/03_branches.en.md)
-### [Pętle](module1/presentation_loops.md)
+### [Loops](module1/04_loops.en.md)
-### [Tablice](module1/presentation_arrays.md)
+### [Arrays](module1/05_arrays.en.md)
-### [Praca domowa](module1/presentation_homework.md)
+### [Homework](module1/06_homework.en.md)
-## [Moduł 2](module2/)
+## [Module 2](module2/index.en.html)
-### [STL](module2/presentation_stl_intro.md)
+### [STL](module2/01_stl_intro.en.md)
-### [`std::vector`](module2/presentation_vector.md)
+### [`std::vector`](module2/02_vector.en.md)
-### [`for` po kolekcji](module2/presentation_range_for.md)
+### [`for` over collection](module2/03_range_for.en.md)
-### [`std::string`](module2/presentation_string.md)
+### [`std::string`](module2/04_string.en.md)
-### [`std::list`](module2/presentation_list.md)
+### [`std::list`](module2/05_list.en.md)
-### [`std::map`](module2/presentation_map.md)
+### [`std::map`](module2/06_map.en.md)
-### [Praca domowa](module2/presentation_homework.md)
+### [Homework](module2/07_homework.en.md)
-## [Moduł 3](module3/)
+## [Module 3](module3/index.en.html)
-### [Zasięg zmiennych](module3/presentation_scopes.md)
+### [Variables scope](module3/01_scopes.en.md)
-### [Referencje](module3/presentation_references.md)
+### [References](module3/02_references.en.md)
-### [Wskaźniki](module3/presentation_pointers.md)
+### [Pointers](module3/03_pointers.en.md)
-### [Zagrożenia](module3/presentation_hazards.md)
+### [Threats](module3/04_hazards.en.md)
-### [`enum` i `enum class`](module3/presentation_enums.md)
+### [`enum` and `enum class`](module3/05_enums.en.md)
-### [Praca domowa](module3/presentation_homework.md)
+### [Homework](module3/07_homework.en.md)
diff --git a/module1/01_types.en.md b/module1/01_types.en.md
new file mode 100644
index 00000000..d0319145
--- /dev/null
+++ b/module1/01_types.en.md
@@ -0,0 +1,206 @@
+
+
+# C++ basics
+
+## Data types
+
+
+
+
+
+___
+
+## Some simple math
+
+* 1 byte == 8 bits
+* In a binary lottery, randomly selected numbers may have values 0 or 1
+* Thus, when drawing 8 numbers, we can get, for example: 1 0 1 0 1 0 1 0
+* There are exactly 256 -> (2^8) such combinations
+* Thus, in 1 byte (8 bits) we can write 256 numbers, e.g. from 0 to 255
+* If we draw 32 numbers in the lottery, (32/8 = 4), i.e. 4 bytes, there are 2^32 such combinations (i.e. over 4 billion)
+
+___
+
+## Empty type - `void`
+
+* Objects of void type cannot be created
+* It is used to indicate that the function does not return anything
+* You can create void* pointers (bad practice in C++)
+* It is NOT used to indicate that the function takes no arguments
+
+```cpp
+int fun(void) { /* ... */ } // bad practice, C style
+int fun() { /* ... */ } // good practice, C++ style
+```
+
+
+___
+
+## Boolean - `bool`
+
+* Size: at least 1 byte (usually equal to just 1)
+ * `sizeof(bool) >= 1`
+* 2 possible values
+ * `false`
+ * `true`
+
+___
+
+## Character types
+
+* Size: 1 byte
+* 256 possible values
+* `char` -> from `-128` to `127`
+* `unsigned char` -> from `0` to `255`
+
+Prefix `unsigned` means that there are no negative numbers i.e. from 0 to some positive value.
+
+
+The size of character types is always 1 byte.
+
+
+The sizes of further types are platform dependent e.g. 32 bits or 64 bits.
+
+
+___
+
+## Integer types
+
+* `short (unsigned short)` - at least 2 bytes
+* `int (unsigned int)` - at least 2 bytes
+* `long (unsigned long)` - at least 4 bytes
+* `long long (unsigned long long)` - at least 8 bytes
+
+___
+
+## Floating-point types
+
+* `float` - usually 4 bytes
+* `double` - usually 8 bytes
+* `long double` - usually 10 bytes (rarely used)
+* Floating point types can always be negative (unsigned versions do not exist)
+* They have special values:
+ * `0`, `-0` (negative zero)
+ * `-Inf`, `+Inf` (infinity)
+ * `NaN` (Not a Number)
+
+Warning! Comparison `NaN == NaN` gives `false`
+
+
+Advanced Reading: [The IEEE754 standard that defines floating point types](https://en.wikipedia.org/wiki/IEEE_754)
+
+
+___
+
+## Type aliases
+
+There are also types that are aliases (different naming for better understanding of type).
+
+`std::size_t` depending on the compiler may be the type (`unsigned short`, `unsigned int`, `unsigned long`, `unsigned long long`). Usually it is the type `unsigned int`. It is worth using it when our variable will refer to some size, e.g. the size of an array.
+
+
+We can create our own type aliases using `typedef` or `using`
+
+
+```cpp
+typedef int Number;
+Number a = 5; // int a = 5;
+
+using Fraction = double;
+Fraction b = 10.2; // double b = 10.2;
+```
+
+
+___
+
+## `auto` type
+
+In some places we can use `auto` type. The compiler will deduce the type itself, e.g. based on the assigned value.
+
+```cpp
+ auto num = 5; // int
+ auto num = 5u; // unsigned int
+ auto num = 5.5; // double
+ auto num = 5.f; // float
+ auto letter = 'a'; // char
+ auto num = false; // bool
+ auto sth; // compilation error, unable to deduce type
+```
+
+___
+
+## Type Sizes
+
+The C++ standard defines such a relationship between the sizes of integer types
+
+```cpp
+1 == sizeof(char) \
+ <= sizeof(short) \
+ <= sizeof(int) \
+ <= sizeof(long) \
+ <= sizeof(long long);
+```
+
+___
+
+## Arithmetic operations
+
+* Basic: + - * /
+* Modifying a variable: += -= *= /=
+* Incrementing (+1) variable: ++
+* Decrementing (-1) variable: --
+
+### Examples
+
+```cpp
+int a = 5 + 7; // a = 12
+```
+
+
+```cpp
+int a = 5;
+a += 7; // a = 12
+```
+
+
+```cpp
+int a = 5;
+++a; // a = 6
+a--; // a = 5
+```
+
+
+___
+
+## Questions
+
+```cpp
+int i = 5;
+auto j = i++ - 1;
+```
+
+What are the values `i` and `j`?
+
+`i = 6`
+
+`j = 4`
+
+What type is `j`?
+
+`int`
+
+___
+
+## A little joke
+
+What do you call 8 hobbits?
+
+A Hobbyte :)
+
+
+___
+
+## Links for extending knowledge
+
+* [Fundamental types on cppreference.com](https://en.cppreference.com/w/cpp/language/types)
+* [The IEEE754 standard that defines floating point types](https://en.wikipedia.org/wiki/IEEE_754)
diff --git a/module1/presentation_types.md b/module1/01_types.pl.md
similarity index 94%
rename from module1/presentation_types.md
rename to module1/01_types.pl.md
index eb48d726..bbd704ec 100644
--- a/module1/presentation_types.md
+++ b/module1/01_types.pl.md
@@ -13,19 +13,19 @@ ___
## Prosta matematyka
* 1 bajt == 8 bitów
-* W binarnym totolotku wylosowane liczby mogą mieć `0` lub `1`
-* Zatem podczas losowania 8 numerków możemy otrzymać przykładowo: `1 0 1 0 1 0 1 0`
-* Takich kombinacji jest dokładnie `256 -> (2^8)`
+* W binarnym totolotku wylosowane liczby mogą mieć 0 lub 1
+* Zatem podczas losowania 8 numerków możemy otrzymać przykładowo: 1 0 1 0 1 0 1 0
+* Takich kombinacji jest dokładnie 256 -> (2^8)
* Zatem na 1 bajcie (8 bitach) możemy zapisać 256 liczb, np. od 0 do 255
-* Jeżeli w totolotku losujemy 32 numerki, (32/8 = 4) czyli 4 bajty to takich kombinacji jest `2^32` (czyli ponad 4 miliardy)
+* Jeżeli w totolotku losujemy 32 numerki, (32/8 = 4) czyli 4 bajty to takich kombinacji jest 2^32 (czyli ponad 4 miliardy)
___
## Typ pusty - `void`
-* Nie można tworzyć obiektów typu `void`
+* Nie można tworzyć obiektów typu void
* Służy do zaznaczenia, że funkcja nic nie zwraca
-* Można tworzyć wskaźniki `void*` (zła praktyka w C++)
+* Można tworzyć wskaźniki void* (zła praktyka w C++)
* NIE służy do oznaczania, że funkcja nie przyjmuje argumentów
```cpp
diff --git a/module1/02_functions.en.md b/module1/02_functions.en.md
new file mode 100644
index 00000000..61ad7691
--- /dev/null
+++ b/module1/02_functions.en.md
@@ -0,0 +1,71 @@
+
+
+# C++ basics
+
+## Functions
+
+
+
+
+
+___
+
+## Functions
+
+A function is a fragment of a program that was given a name and we can execute it by calling its name and pass it possible arguments.
+
+Function == subprogram == procedure
+
+For example, when cycling, our main function is to move from point A to B. However, we also perform several subroutines such as gear shifting, braking, accelerating, turning. Similarly, in a program, we can isolate specific behaviors and transfer them to functions that we will name to suggest what they do. It is important that the function only does one thing. One function changes gears, the other brakes, the third turns.
+
+___
+
+## Function signatures (declarations)
+
+`void fun(int)` - the function is named fun, returns nothing, and takes one int.
+
+### Guess signatures by description
+
+A function called `foo` that returns nothing and takes one argument of type `double`.
+
+
+`void foo(double)`
+
+
+A function called `bar` that returns type double and takes 2 arguments. The first is `float` and the second is `const int` (`const` means the value cannot be modified).
+
+
+`double bar(float, const int)`
+
+
+___
+
+## Function calls
+
+`foo(5.0)` -> we call the function `foo` with an argument `double` which is equal to `5.0`
+
+
+`double result = bar(5.4f, 10)` -> we call the function `bar` with an argument `float (5.4f)` and `int (10)` and we assign its result to a variable of type `double` named `result`.
+
+
+___
+
+## Exercise
+
+Add the missing function `multiply`. It is supposed to multiply two numbers given as its parameters. [Download the exercise][homework]
+
+```cpp
+#include
+
+// Write missing function here
+
+int main() {
+ std::cout << "4 * 5: " << multiply(4, 5) << "\n";
+ std::cout << "10 * 5: " << multiply(10, 5) << "\n";
+ std::cout << "-5 * 5: " << multiply(-5, 5) << "\n";
+
+ return 0;
+}
+```
+
+[homework]: https://github.com/coders-school/cpp-fundamentals/blob/master/module1/task1.cpp
diff --git a/module1/presentation_functions.md b/module1/02_functions.pl.md
similarity index 76%
rename from module1/presentation_functions.md
rename to module1/02_functions.pl.md
index c863d617..54003cd1 100644
--- a/module1/presentation_functions.md
+++ b/module1/02_functions.pl.md
@@ -16,7 +16,7 @@ Funkcja jest to fragment programu, któremu nadano nazwę i który możemy wykon
Funkcja == podprogram == procedura
-Przykładowo, w trakcie jazdy na rowerze naszą główną funkcją jest przemieszczanie się z punktu a do b. Jednak wykonujemy także kilka podprogramów, jak zmiana biegów, hamowanie, rozpędzanie, skręcanie. Podobnie w programie możemy wydzielić konkretne zachowania i przenieść je do funkcji, które nazwiemy tak, by sugerowały co robią. Ważne, aby funkcja robiła tylko jedną rzecz. Jedna funkcja zmienia biegi, druga hamuje, trzecia skręca.
+Przykładowo, w trakcie jazdy na rowerze naszą główną funkcją jest przemieszczanie się z punktu A do B. Jednak wykonujemy także kilka podprogramów, jak zmiana biegów, hamowanie, rozpędzanie, skręcanie. Podobnie w programie możemy wydzielić konkretne zachowania i przenieść je do funkcji, które nazwiemy tak, by sugerowały co robią. Ważne, aby funkcja robiła tylko jedną rzecz. Jedna funkcja zmienia biegi, druga hamuje, trzecia skręca.
___
@@ -26,13 +26,17 @@ ___
### Odgadnijcie sygnatury po opisie
-Funkcja o nazwie foo, która nic nie zwraca a przyjmuje jeden argument typu double.
+Funkcja o nazwie `foo`, która nic nie zwraca a przyjmuje jeden argument typu `double`.
+
-`void foo(double)`
+`void foo(double)`
+
-Funkcja o nazwie bar, która zwraca typ double a przyjmuje 2 argumenty. Pierwszy to float, a drugi to const int (const oznacza, że wartość ta nie może zostać zmodyfikowana).
+Funkcja o nazwie `bar`, która zwraca typ double a przyjmuje 2 argumenty. Pierwszy to `float`, a drugi to `const int` (`const` oznacza, że wartość ta nie może zostać zmodyfikowana).
+
-`double bar(float, const int)`
+`double bar(float, const int)`
+
___
@@ -64,4 +68,4 @@ int main() {
}
```
-[zadanie-domowe]: https://github.com/coders-school/cpp-fundamentals/blob/master/module1/task1.cpp
\ No newline at end of file
+[zadanie-domowe]: https://github.com/coders-school/cpp-fundamentals/blob/master/module1/task1.cpp
diff --git a/module1/03_branches.en.md b/module1/03_branches.en.md
new file mode 100644
index 00000000..78d5df4f
--- /dev/null
+++ b/module1/03_branches.en.md
@@ -0,0 +1,111 @@
+
+
+# C++ basics
+
+## Conditional statements
+
+
+
+
+
+___
+
+## `if` statement
+
+A conditional statement is nothing more than asking the program a question, for example:
+
+* Have you received all the data?
+* Has the boss's life dropped to 0?
+* Has the achievement been earned by the player?
+* Is the number greater than the maximum allowed?
+
+___
+
+## `if` construction
+
+```cpp
+if (condition) {
+ // do sth
+}
+```
+
+___
+
+## Combining conditions
+
+What if a lot of conditions have to be met?
+We can combine conditions with an operator **or** (`||`, `or`) or **and** (`&&`, `and`)
+
+```cpp
+if (are_potatoes_eatten && is_meat_eatten && is_salad_eatten)
+```
+
+
+All 3 conditions must be met
+
+```cpp
+if (player_has_20_dex || player_has_18_int || player_has_22_str)
+```
+
+
+In this case, it is enough to meet one of 3 conditions. They can all be met, but it is enough for any of them to be met.
+
+___
+
+## `else` statement
+
+If the program can react differently to meeting certain conditions, we can use `if else` constructions
+
+```cpp
+if (number < 2) {
+ critical_miss();
+} else if (number < 18) {
+ hit();
+} else {
+ critical_hit();
+}
+```
+
+___
+
+## `switch/case` statement
+
+```cpp
+char option = getInput();
+switch (option) {
+case 'l':
+ goLeft();
+ break;
+case 'r':
+ goRight();
+ break;
+default:
+ exit();
+}
+```
+
+* `case` stands for a specific case
+* `break` announces that we are exiting the conditional statement `switch` and we continue with the rest of the program. Its absence will result in the execution of the instructions from the next `case`.
+* `default` is place where program will end up if no other condition is met
+
+___
+
+## Exercise
+
+Add a function `max`. It is supposed to return the maximum of the three given values. [Download the exercise][homework]
+
+```cpp
+#include
+
+// Write your function here
+
+int main() {
+ std::cout << "max (1, 2, 3): " << max(1, 2, 3) << "\n";
+ std::cout << "max (2, 3, 1): " << max(2, 3, 1) << "\n";
+ std::cout << "max (3, 2, 1): " << max(3, 2, 1) << "\n";
+
+ return 0;
+}
+```
+
+[homework]: https://github.com/coders-school/cpp-fundamentals/blob/master/module1/task2.cpp
diff --git a/module1/presentation_branches.md b/module1/03_branches.pl.md
similarity index 97%
rename from module1/presentation_branches.md
rename to module1/03_branches.pl.md
index e23fe615..f27cec64 100644
--- a/module1/presentation_branches.md
+++ b/module1/03_branches.pl.md
@@ -86,7 +86,7 @@ default:
* `case` oznacza konkretny przypadek
* `break` informuje, że wychodzimy z instrukcji warunkowej `switch` i konstytuujemy dalej program. Jego brak spowoduje, że wykonają się instrukcje z kolejnego `case`.
-* `deafult` jest to miejsce gdzie program dotrze, gdy żaden inny warunek nie zostanie spełniony
+* `default` jest to miejsce gdzie program dotrze, gdy żaden inny warunek nie zostanie spełniony
___
diff --git a/module1/04_loops.en.md b/module1/04_loops.en.md
new file mode 100644
index 00000000..02bb6a5f
--- /dev/null
+++ b/module1/04_loops.en.md
@@ -0,0 +1,125 @@
+
+
+# C++ basics
+
+## Loops
+
+
+
+
+
+___
+
+## Loops
+
+A loop is used to repeat statements that we want to execute more than once without having to write them over and over in the code.
+
+Basic loops: `while`, `for`
+
+___
+
+## `while` loop
+
+ We use `while` when we want to do something until some condition is met. Usually we have no idea when it is going to happen (we don't know the number of steps), e.g .:
+
+* We browse the shirts on the Internet until we find a match for us
+* We repeat the fight with the same boss until we defeat him
+* We eat the soup until the plate is empty
+* We search through the contacts on the phone until we find the person we want to talk to
+
+___
+
+### `while` loop construction
+
+```cpp
+while (condition) {
+ // Do sth
+}
+```
+
+### Example
+
+```cpp
+while (a == b) {
+ std::cin >> a;
+ std::cin >> b;
+}
+```
+
+
+___
+
+## `for` loop
+
+We use `for` when we want to do something a certain number of times. We usually know the number of steps, e.g.
+
+* We fill out a questionnaire consisting of 10 questions -> number of steps: 10
+* We move from point A to B -> number of steps = distance / step length
+* We are writing an exam consisting of 4 tasks -> the number of steps (if we are prepared, 4, if not, we do the subroutine `cheat`)
+* We fasten our shirts (as long as we don't tear any button out)
+
+___
+
+### `for` loop construction
+
+```cpp
+for (variable = initial_value; condition; variable_change) {
+ // Do sth
+}
+```
+
+### Example
+
+```cpp
+for (size_t i = 0 ; i < 10 ; i+=2) {
+ std::cout << "i: " << i << '\n';
+}
+```
+
+
+___
+
+Every loop `for` can be changed to `while` and vice versa. We choose the more convenient notation for us, usually depending if we know the number of steps.
+
+But there is another type of loop.
+
+___
+
+## `do/while` loop
+
+```cpp
+do {
+ // Do sth
+} while(condition)
+```
+
+Code in `while` or `for` loops may not be executed even once if the condition is never met.
+
+Code in `do/while` loop will be performed at least once.
+
+___
+
+## Exercise
+
+Add a function `printString`. It is supposed to print the text given in the first argument as many times as the value of the number given in the second argument. [Download the exercise][homework]
+
+```cpp
+#include
+
+// Write your function here
+
+int main() {
+ printString("Hello", 5);
+ std::cout << "\n";
+
+ printString("AbC", 2);
+ std::cout << "\n";
+
+ printString("HiHi ", 6);
+ std::cout << "\n";
+
+ return 0;
+}
+```
+
+[homework]: https://github.com/coders-school/cpp-fundamentals/blob/master/module1/task3.cpp
diff --git a/module1/presentation_loops.md b/module1/04_loops.pl.md
similarity index 97%
rename from module1/presentation_loops.md
rename to module1/04_loops.pl.md
index 827b545c..066e9862 100644
--- a/module1/presentation_loops.md
+++ b/module1/04_loops.pl.md
@@ -20,7 +20,7 @@ ___
## Pętla `while`
-`while` używamy, gdy chcemy coś wykonać dopóki nie zostanie spełniony jakiś warunek. Przeważnie nie mamy pojęcia, kiedy to następy (nie znamy liczby kroków) np:
+`while` używamy, gdy chcemy coś wykonać dopóki nie zostanie spełniony jakiś warunek. Przeważnie nie mamy pojęcia, kiedy to nastąpi (nie znamy liczby kroków) np:
* Przeglądamy koszule w Internecie dopóki nie znajdziemy pasującej do nas
* Powtarzamy walkę z tym samym bossem aż go nie pokonamy
@@ -122,4 +122,4 @@ int main() {
}
```
-[zadanie-domowe]: https://github.com/coders-school/cpp-fundamentals/blob/master/module1/task3.cpp
\ No newline at end of file
+[zadanie-domowe]: https://github.com/coders-school/cpp-fundamentals/blob/master/module1/task3.cpp
diff --git a/module1/05_arrays.en.md b/module1/05_arrays.en.md
new file mode 100644
index 00000000..5ace110e
--- /dev/null
+++ b/module1/05_arrays.en.md
@@ -0,0 +1,84 @@
+
+
+# C++ basics
+
+## Arrays
+
+
+
+
+
+___
+
+## Introduction to arrays
+
+# 🚃🚃🚃🚃🚃🚃🚃🚃🚃🚃
+
+* Arrays can be treated like wagons in a train
+* Arranged one by one and connected to each other
+* They can hold different types like human, coal, etc.
+* We can write 10 coal wagons as Coal tab[10] - it means that we create an array that stores 10 elements of type Coal.
+
+___
+
+
+
+* In C++, the array is in one continuous area in memory and is inseparable (its elements cannot be removed)
+* All items are of the same type
+* The array is always indexed from 0
+* `tab[0]` - the first element of the array `tab`
+* `tab[9]` - the last element of a 10-element array `tab`
+
+___
+
+## Example of array modification
+
+```cpp
+int tab[10];
+tab[0] = 1;
+tab[1] = 2;
+// ...
+tab[9] = 10;
+```
+
+This could be done better with a loop.
+
+___
+
+### `operator[]`
+
+We refer to an array element with `operator[]`. We must remember to always refer to an existing array element. Otherwise the program will have undefined behavior as we will try to access memory that is not in the array. It's called garbage. At best, the operating system will detect it and we'll get a **crash** (segmentation fault). At worst, we will work on some incorrect random data. The effects can be very serious (space shuttle crashes, irradiation from medical apparatus).
+
+```cpp
+int tab[10];
+tab[10] = 42; // !!! undefined behavior (UB)
+```
+
+
+___
+
+## Exercise
+
+Modify the program so that it fills the array with the following odd numbers: 1, 3, 5, 7, ... [Download the exercise][homework]
+
+```cpp
+#include
+
+constexpr size_t tab_size = 100;
+
+int main() {
+ int tab[tab_size];
+
+ for (size_t i = 0; i < tab_size; ++i) {
+ tab[i] = i;
+ }
+
+ for (size_t i = 0; i < tab_size; ++i) {
+ std::cout << tab[i] << "\n";
+ }
+
+ return 0;
+}
+```
+
+[homework]: https://github.com/coders-school/cpp-fundamentals/blob/master/module1/task4.cpp
diff --git a/module1/presentation_arrays.md b/module1/05_arrays.pl.md
similarity index 92%
rename from module1/presentation_arrays.md
rename to module1/05_arrays.pl.md
index 1f82087a..f01c93b0 100644
--- a/module1/presentation_arrays.md
+++ b/module1/05_arrays.pl.md
@@ -17,11 +17,11 @@ ___
* Tablice można traktować jak wagony w pociągu
* Ustawione kolejno jeden po drugim i połączone ze sobą
* Mogą pomieścić różne typy, jak człowiek, węgiel, itp.
-* 10 wagonów z węglem możemy zapisać jako `Coal tab[10]` - oznacza to, że tworzymy tablicę, która przechowuje 10 elementów typu Coal (węgiel).
+* 10 wagonów z węglem możemy zapisać jako Coal tab[10] - oznacza to, że tworzymy tablicę, która przechowuje 10 elementów typu Coal (węgiel).
___
-
+
* W C++ tablica znajduje się w jednym, ciągłym obszarze w pamięci i jest nierozłączna (nie można usuwać jej elementów)
* Wszystkie elementy są tego samego typu
diff --git a/module1/06_homework.en.md b/module1/06_homework.en.md
new file mode 100644
index 00000000..fcd81823
--- /dev/null
+++ b/module1/06_homework.en.md
@@ -0,0 +1,133 @@
+
+
+# C++ basics
+
+## Summary
+
+
+
+
+
+___
+
+## What do you remember from today?
+
+### Write as many keywords as possible in the chat
+
+
+1. Data types
+ * `void`, `bool`, `char`, `int`, `double` + their varieties
+1. Functions
+ * signature (declaration) = return type, name, arguments
+1. Conditional statements
+ * `if`, `switch/case`
+1. Loops
+ * `for`, `while`, `do/while`
+1. Arrays
+ * `Type t[N]`, `operator[]`
+
+___
+
+
+## Homework
+
+### Post-work
+
+
+* Read about [std::string](https://en.cppreference.com/w/cpp/string/basic_string) in the documentation. You will find there, among others, description of `std::to_string` function. It will be useful 🙂
+* Task 1 - Calculate (5 points)
+* Task 2 - Fibonacci - recursion and iteration (6 points)
+
+
+#### Bonus for punctuality
+
+For delivering each task before May 24, 2020 (Sunday) until 23:59 you will get 2 bonus points (4 points in total for 2 tasks).
+
+### Pre-work
+
+* Read about the [std :: vector](https://en.cppreference.com/w/cpp/container/vector) type documentation. Click on the different functions and look mainly at the usage examples at the bottom of the pages.
+* You can look at the test files in the tasks and try to add your own test cases
+
+#### [Repo tasks](https://github.com/coders-school/cpp-fundamentals/tree/master/module1/homework)
+
+___
+
+
+## Task 1 - Calculate
+
+Implement a function whose task is to perform arithmetic operations on two numbers.
+
+Signature - `std::string calculate(const std::string& command, int first, int second)`.
+
+### Parameters
+
+* `const std::string& command` - type of arithmetic operation. One of `add`, `subtract`, `multiply`, `divide`
+* `int first` - first number
+* `int second` - second number
+
+### Return value
+
+* `std::string` - the result of the operation as text
+
+In case of a wrong parameter `command` the function should return the string "Invalid data".
+
+### Examples
+
+```cpp
+auto result = calculate("add", 2, 3); // result = "5"
+result = calculate("multiply", 2, 3); // result = "6"
+result = calculate("hello", 2, 3); // result = "Invalid data"
+```
+
+___
+
+## Task 2 - Fibonacci
+
+Implement two functions. Both are supposed to count the n-th number of [Fibonacci sequence](https://pl.wikipedia.org/wiki/Ciąg_Fibonacci), but in different ways.
+
+* iterative (using loops)
+* recursively (the function is supposed to call itself)
+
+Functions must have specific signatures:
+
+```cpp
+int fibonacci_iterative(int sequence);
+int fibonacci_recursive(int sequence);
+```
+
+___
+
+
+## Task delivery
+
+1. Fork a repo [cpp-fundamentals](https://github.com/coders-school/cpp-fundamentals)
+2. Get your fork - `git clone https://github.com/YOURNICK/cpp-fundamentals.git`
+3. Go to the cpp-fundamentals directory - `cd cpp-fundamentals`
+4. Create a branch named `calculate` for calculate problem solution - `git checkout -b calculate`
+5. Go to the directory module1/homework/calculate - `cd module1/homework/calculate`
+6. Here is the backbone of the program that you must complete. It already includes tests to verify that your implementation is correct. Before starting the implementation, enter the following commands:
+
+```bash
+mkdir build # creates build directory
+cd build # change directory to build
+cmake .. # generates Makefile by following instructions from ../CMakeLists.txt
+make # compilation
+ctest -V # running tests
+```
+
+7. Implement the functionality (piece by piece, e.g. start from adding operation only)
+8. Check if the implementation passes the tests - `make` (compilation) and `ctest -V` (test launch)
+9. Make a commit with a description of the functionality - `git commit -am"adding works"`
+10. Go back to step 7 and implement next functionality. If the solution passes all tests, go to the next step
+11. Push changes to your fork - `git push origin calculate`
+12. Click on Pull Request on GitHub.
+13. Wait a moment for the Continuous Integration (CI) report to see if the solution compiles and tests pass on GitHub as well.
+14. If there is ✅ - good job, the solution is correct. If there is ❌ click on it and check the error description. Correct it (points 7-11) and wait for the next CI report.
+
+___
+
+## Delivery of remaining tasks
+
+First, go back to the main branch - `git checkout master` and proceed from step 4 for the next task (creating a new branch with a different name)
+
+You may notice that switching to a different branch has resulted in you missing the solution for the first task. Don't worry, it's just on a different branch. You can return to it by going to the branch of this task - `git checkout nazwa`.
diff --git a/module1/presentation_homework.md b/module1/06_homework.pl.md
similarity index 100%
rename from module1/presentation_homework.md
rename to module1/06_homework.pl.md
diff --git a/module1/img/array.gif b/module1/img/array.gif
deleted file mode 100644
index 74352787..00000000
Binary files a/module1/img/array.gif and /dev/null differ
diff --git a/module1/img/array.png b/module1/img/array.png
new file mode 100644
index 00000000..0c26cf44
Binary files /dev/null and b/module1/img/array.png differ
diff --git a/module1/index.en.html b/module1/index.en.html
new file mode 100644
index 00000000..0b854364
--- /dev/null
+++ b/module1/index.en.html
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+ C++ - basics - Coders School
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/module1/index.html b/module1/index.pl.html
similarity index 93%
rename from module1/index.html
rename to module1/index.pl.html
index 9fb36ba3..f84cf026 100644
--- a/module1/index.html
+++ b/module1/index.pl.html
@@ -79,27 +79,27 @@
Łukasz Ziobroń
You can change the port by using npm start -- --port=8001.
-->
-
-
-
-
-
-
diff --git a/module2/01_stl_intro.en.md b/module2/01_stl_intro.en.md
new file mode 100644
index 00000000..b3c97417
--- /dev/null
+++ b/module2/01_stl_intro.en.md
@@ -0,0 +1,21 @@
+
+
+# C++ basics
+
+## STL
+
+
+
+
+
+___
+
+## Standard Template Library
+
+* Standard Template Library is available in the C++ language standard
+* frequently used items from STL:
+ * `std::vector`
+ * `std::string`
+ * `std::map`
+ * `std::cout` and `std::cin`
+ * iterators
diff --git a/module2/presentation_stl_intro.md b/module2/01_stl_intro.pl.md
similarity index 100%
rename from module2/presentation_stl_intro.md
rename to module2/01_stl_intro.pl.md
diff --git a/module2/02_vector.en.md b/module2/02_vector.en.md
new file mode 100644
index 00000000..fdd88bd6
--- /dev/null
+++ b/module2/02_vector.en.md
@@ -0,0 +1,62 @@
+
+
+# C++ basics
+
+## `std::vector`
+
+
+
+
+
+___
+
+## Features `std::vector`
+
+* very widely used
+* dynamic array
+* we do not have to specify how many elements we want in advance
+* it is in one continuous memory area (like an array)
+* it manages the memory itself
+ * it will take care of allocating new memory when it is needed
+ * it will take care of memory deallocation when we no longer need it
+
+___
+
+## Creating a vector
+
+```cpp
+std::vector numbers;
+```
+
+* a vector always needs to know what type of data it is holding
+* the data type is given in angle brackets <>
+
+___
+
+## Vector initialization with values
+
+```cpp
+std::vector numbers = {1, 2, 3, 4, 5};
+std::vector numbers {1, 2, 3, 4, 5};
+```
+
+
+* both types of initialization (with = and without) are equivalent in the case of vector
+
+___
+
+## Vector operations
+
+* adding an element to the vector
+ * `numbers.push_back(5)`
+* reading an element from a vector
+ * `numbers[1]`
+* assigning multiple elements to a vector
+ * `numbers = {1,2,3,4,5}`
+* getting the first element from the vector
+ * `numbers.front()`
+* getting the last element from the vector
+ * `numbers.back()`
+
+[Documentation on cppreference.org](https://en.cppreference.com/w/cpp/container/vector)
+
diff --git a/module2/presentation_vector.md b/module2/02_vector.pl.md
similarity index 100%
rename from module2/presentation_vector.md
rename to module2/02_vector.pl.md
diff --git a/module2/03_range_for.en.md b/module2/03_range_for.en.md
new file mode 100644
index 00000000..f0967c2b
--- /dev/null
+++ b/module2/03_range_for.en.md
@@ -0,0 +1,101 @@
+
+
+# C++ basics
+
+## `for` loop over container
+
+
+
+
+
+___
+
+## Ranges
+
+* Each container (including an array or vector) has its end and beginning
+ * function `begin()` returns the beginning of the container
+ * function `end()` returns the end of the container
+ * (in a very simplified way, we will elaborate on this topic with iterators)
+
+___
+
+## Range based `for` loop
+
+Thanks to the information about start and end of range, we can write a loop iterating through the entire scope of the container.
+
+
+```cpp
+for (auto i = vec.begin(); i != vec.end(); ++i) {
+ auto element = *i;
+ // do sth on element
+}
+```
+
+
+However, this notation is unnecessarily complex and unreadable.
+That is why `range loop` were created which allow easy notation `for (type name : container)`.
+
+The compiler can generate code above, if we use the notation below.
+
+```cpp
+for (auto element : vec) {
+ // do sth on element
+}
+```
+
+
+___
+
+## Task
+
+Write a function `printVector` which will take `std::vector` as an argument and print its contents using a `for` loop over the collection.
+Each item on a new line.
+[Download the task][task1]
+
+```cpp
+#include
+#include
+#include
+
+// Implement printVector
+
+int main() {
+ std::vector vec {
+ "Hello Coders School!",
+ "Welcome to the best C++ course ever",
+ "Man, this is crazy :)"
+ };
+ printVector(vec);
+ return 0;
+}
+```
+
+[task1]: https://github.com/coders-school/cpp-fundamentals/tree/master/module2/task1.cpp
+
+___
+
+## Task
+
+Write a function `concatenateVector` which will take 2 vectors as arguments and then return one which will contain alternating elements from the first and second vector.
+For example, for the following `vec1` and `vec2` it should return: `{1, 11, 2, 12, 3, 13, 4, 14, 5, 15}`
+[Download the task][task2]
+
+```cpp
+#include
+#include
+
+// Implement concatenateVector
+
+int main() {
+ std::vector vec1 {1, 2, 3, 4, 5};
+ std::vector vec2 {11, 12, 13, 14, 15};
+
+ auto vec = concatenateVector(vec1, vec2);
+ for (const auto& el : vec) {
+ std::cout << el << " ";
+ }
+ return 0;
+}
+```
+
+[task2]: https://github.com/coders-school/cpp-fundamentals/tree/master/module2/task2.cpp
diff --git a/module2/presentation_range_for.md b/module2/03_range_for.pl.md
similarity index 95%
rename from module2/presentation_range_for.md
rename to module2/03_range_for.pl.md
index 2088d2f8..c00eee93 100644
--- a/module2/presentation_range_for.md
+++ b/module2/03_range_for.pl.md
@@ -48,7 +48,7 @@ ___
## Zadanie
-Napisz funkcję `printVector`, która przyjmie jako argument `std::vector` i wypisze jego zawartość przy użyciu pętli for przy kolekcji.
+Napisz funkcję `printVector`, która przyjmie jako argument `std::vector` i wypisze jego zawartość przy użyciu pętli `for` przy kolekcji.
Każdy element w nowej linii.
[Pobierz zadanie][task1]
@@ -77,7 +77,7 @@ ___
## Zadanie
Napisz funkcję `concatenateVector`, która przyjmie jako argumenty 2 wektory a następnie zwróci jeden, który będzie zawierał naprzemiennie elementy z pierwszego i drugiego wektora.
-Np. dla poniższych vec1 i vec2 powinna zwrócić: `{1, 11, 2, 12, 3, 13, 4, 14, 5, 15}`
+Np. dla poniższych `vec1` i `vec2` powinna zwrócić: `{1, 11, 2, 12, 3, 13, 4, 14, 5, 15}`
[Pobierz zadanie][task2]
```cpp
diff --git a/module2/04_string.en.md b/module2/04_string.en.md
new file mode 100644
index 00000000..513c16ff
--- /dev/null
+++ b/module2/04_string.en.md
@@ -0,0 +1,36 @@
+
+
+# C++ basics
+
+## `std::string`
+
+
+
+
+
+___
+
+## Character container - `std::string`
+
+* a special container that stores characters
+* std::string also has a beginning and an end, like any container
+* similar functions to std::vector
+
+___
+
+## Operations on `std::string`
+
+* adding a character at the end
+ * `str.push_back('a')` (nobody does that 🙂)
+ * we recommend `str += 'a';`
+* reading a single character
+ * `str[1]`
+* initialization
+ * `std::string str("Hello")`
+ * `std::string str = "Hello"`
+* assigning the entire string
+ * `str = "Hello"`
+* getting the first character
+ * `str.front()`
+* getting the last character
+ * `str.back()`
diff --git a/module2/presentation_string.md b/module2/04_string.pl.md
similarity index 100%
rename from module2/presentation_string.md
rename to module2/04_string.pl.md
diff --git a/module2/05_list.en.md b/module2/05_list.en.md
new file mode 100644
index 00000000..250de094
--- /dev/null
+++ b/module2/05_list.en.md
@@ -0,0 +1,120 @@
+
+
+# C++ basics
+
+## `std::list`
+
+
+
+
+
+___
+
+## List
+
+### Question: what features did `std::vector` have?
+
+
+Unlike a vector, the list is scattered around the memory. Which is sometimes convenient, because we can use fragments of memory,
+that could be inaccessible to the vector.
+
+
+### Question: How do list elements know about each other's existence?
+
+
+Each list item stores a pointer to either the next item (one-way linked list) or the next and previous item (two-way linked list).
+
+
+___
+
+
+## Operations on `std::list`
+
+* getting the first and last item in a list
+ * `front()`
+ * `back()`
+* the beginning and the end of the map
+ * `begin()`
+ * `end()`
+* information about the number of items in the list
+ * `size()`
+* information whether the list is empty
+ * `empty()`
+* adding an item to the end of the list
+ * `push_back()`
+* NEW adds an item to the beginning of the list
+ * `push_front()`
+* NEW sorting list items (can't use std::sort for list)
+ * `sort()`
+
+[Documentation on cppreference.org](https://en.cppreference.com/w/cpp/container/list)
+
+
+___
+
+## Question: how do I get to the 10th list item?
+
+Since each list item knows only about the previous and next items, we can't get to the 10th item that easily.
+
+
+We can access the first item via `front()` or `*begin()`
+
+
+```cpp
+int main() {
+ std::list list {1, 2, 3, 4, 5};
+ std::cout << *list.begin();
+ std::cout << list.front();
+}
+```
+
+
+___
+
+We can access the 10th element by going from 1 to 10.
+
+```cpp
+int main() {
+ std::list list {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+ auto it = list.begin();
+ for (size_t i = 0 ; i < 10 ; ++i) {
+ ++it; // jump to next element
+ }
+ std::cout << *it;
+}
+```
+
+
+It takes more time than getting to the 10th element in `std::vector`.
+
+
+___
+
+## Task
+
+Write a function that takes a vector and returns a list that contains the sorted values from the vector. [Download the task][task3]
+
+```cpp
+#include
+#include
+
+// Implement createSortedList
+// It should take a vector and return a list of sorted elements
+// add proper include :)
+
+int main() {
+ std::vector vec{2, 3, 4, 1, 6, 5, 8, 7, 9, 0};
+ auto list = createSortedList(vec);
+
+ for (const auto& el : list)
+ std::cout << el << " ";
+
+ return 0;
+}
+```
+
+[task3]: https://github.com/coders-school/cpp-fundamentals/tree/master/module2/task3.cpp
+
+___
+
+## Question: when is it profitable to use `std::list` and when `std::vector`?
diff --git a/module2/presentation_list.md b/module2/05_list.pl.md
similarity index 97%
rename from module2/presentation_list.md
rename to module2/05_list.pl.md
index 7bc09a4e..52736dc0 100644
--- a/module2/presentation_list.md
+++ b/module2/05_list.pl.md
@@ -16,7 +16,7 @@ ___
Lista w przeciwieństwie do wektora jest porozrzucana po pamięci. Co czasami jest wygodne, gdyż możemy wykorzystać fragmenty pamięci,
-które mogłyby, by być niedostępne dla wektora.
+które mogłyby być niedostępne dla wektora.
### Pytanie: skąd elementy listy wiedzą o swoim wzajemnym istnieniu?
@@ -67,7 +67,7 @@ int main() {
std::cout << list.front();
}
```
-
+
___
diff --git a/module2/06_map.en.md b/module2/06_map.en.md
new file mode 100644
index 00000000..51b8e905
--- /dev/null
+++ b/module2/06_map.en.md
@@ -0,0 +1,156 @@
+
+
+# C++ basics
+
+## `std::map`
+
+
+
+
+
+___
+
+## Map, dictionary
+
+* map is a set of pairs (key, value)
+* `std::map` in C++ is equivalent to `dict` from Python
+
+For example, we create a collection of favorite CDs and arrange them on a shelf.
+
+Of course, we have a huge number of these CDs and we would like to be able to find the CD easily when we search for it.
+
+For this purpose, we number all the CDs and write down information on a piece of paper under which number which title is placed. This is how we create a map.
+
+
+```cpp
+std::map discs {
+ {1, "The Lord of the Rings: The Fellowship of the Ring"},
+ {2, "The Lord of the Rings: The Two Towers"},
+ {3, "The Lord of the Rings: The Return of the King"}
+};
+```
+
+
+The key here is the number, while the value is the title of the movie.
+
+
+___
+
+## Operations on `std::map`
+
+* beginning and end of range
+ * `begin()`
+ * `end()`
+* information about the number of items in the map
+ * `size()`
+* information if the map is empty
+ * `empty()`
+* access to the item for the specified key
+ * `operator[key]`
+* adding a pair (key, value) to the map if such a pair does not exist in it yet
+ * `insert({key, value})`
+
+[Documentation on cppreference.org](https://en.cppreference.com/w/cpp/container/map)
+
+
+___
+
+## Question
+
+What will happen when we call on the mentioned map:
+
+```cpp
+discs[4] = "Harry Potter";
+```
+
+Assigning something to a map element with `operator[]` makes it so:
+
+
+* if there is already a value for a given key, we will replace it.
+* if there is no value for a given key, we will create a new pair (key, value)
+
+___
+
+
+## Let's execute this code
+
+```cpp
+#include
+#include