Skip to content

Commit be7ef31

Browse files
euppborunostephen-hero
authored
Add Module 3: Object-Oriented Programming and Ownership Semantics (#25)
add module 3: object-oriented programming and ownership semantics (#25) --------- Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com> Co-authored-by: Dmitrii Kotov <87141565+boruno@users.noreply.github.com> Co-authored-by: Mikhail Oshukov <Mikhail.Oshukov@jetbrains.com>
1 parent 68c75b0 commit be7ef31

File tree

447 files changed

+16067
-752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

447 files changed

+16067
-752
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ sfml/*
99

1010
Makefile
1111
CMakeCache.txt
12+
.DS_Store

MemoryManagement/LinkedList/LinkedList/src/approaching.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "scene.hpp"
1+
#include "game.hpp"
22

33
void approachingLoop(Circle player, Circle consumable[], bool concerned[], int size) {
44
for (int i = 0; i < size; ++i) {

MemoryManagement/LinkedList/LinkedList/src/borders.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "scene.hpp"
1+
#include "game.hpp"
22

33
Point2D adjustToBorders(Point2D position) {
44
Point2D result = position;

MemoryManagement/LinkedList/LinkedList/src/collision.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <cmath>
22

3-
#include "scene.hpp"
3+
#include "game.hpp"
44

55
float distance(Point2D a, Point2D b) {
66
float dx = a.x - b.x;

MemoryManagement/LinkedList/LinkedList/src/direction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "scene.hpp"
1+
#include "game.hpp"
22

33
Point2D getDirection(Direction direction) {
44
switch (direction) {

MemoryManagement/LinkedList/LinkedList/src/generate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "scene.hpp"
1+
#include "game.hpp"
22

33
#include <cstdlib>
44

MemoryManagement/LinkedList/LinkedList/src/loop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "scene.hpp"
1+
#include "game.hpp"
22

33
void collisionLoop(Circle player, Circle consumable[], bool consumed[], int size) {
44
for (int i = 0; i < size; ++i) {

MemoryManagement/LinkedList/LinkedList/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <SFML/Graphics.hpp>
22

3-
#include "scene.hpp"
3+
#include "game.hpp"
44
#include "dllist.hpp"
55

66
const int MAX_CONSUMABLES_COUNT = 8;

MemoryManagement/LinkedList/LinkedList/src/point.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "scene.hpp"
1+
#include "game.hpp"
22

33
Point2D add(Point2D a, Point2D b) {
44
Point2D c = { 0, 0 };

MemoryManagement/LinkedList/LinkedList/task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void link(Node* cursor, Node* node);
5555
It should link together the `cursor` and `node` nodes, putting `node` right after `cursor`.
5656
Make sure to properly update the `next` and `prev` fields of all relevant nodes,
5757
that is, the nodes pointed by the `cursor`, `cursor->next`, and `node` pointers.
58-
You might assume that all nodes reachable from `cursor` through `next` and `prev`
58+
You might assume that all nodes which are reachable from `cursor` through `next` and `prev`
5959
are valid nodes and none of their `next` or `prev` pointers are null
6060
(we will see why this is true for our intended list implementation later).
6161
@@ -91,7 +91,7 @@ struct List {
9191
For this scheme to work properly, we also have to initialize the
9292
`next` and `prev` fields of the `sentry` node.
9393
We can make them both point to the `sentry` node.
94-
Therefore, in our encoding, an empty list is modelled as
94+
Therefore, in our encoding, an empty list is modeled as
9595
a list consisting of a single sentinel node whose `next` and `prev` pointers form a cycle.
9696
Write code for the function `initList` implementing this idea
9797
(set the `data` field of the `sentry` node to `nullptr`):

0 commit comments

Comments
 (0)