{"id":20315331,"url":"https://github.com/madebypixel02/cpp-module-01","last_synced_at":"2026-03-07T22:07:58.288Z","repository":{"id":109077976,"uuid":"447301469","full_name":"madebypixel02/CPP-Module-01","owner":"madebypixel02","description":"[42 Madrid] BraiiiiiiinnnzzzZ","archived":false,"fork":false,"pushed_at":"2022-12-04T15:40:45.000Z","size":1381,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-22T22:34:22.754Z","etag":null,"topics":["42","42-cpp-module","42-cursus","42born2code","42madrid","42school","born2code","brain","cpp","makefile","peer2peer","zombie"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madebypixel02.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-12T17:01:22.000Z","updated_at":"2025-06-03T11:45:10.000Z","dependencies_parsed_at":"2023-05-31T21:16:07.698Z","dependency_job_id":null,"html_url":"https://github.com/madebypixel02/CPP-Module-01","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/madebypixel02/CPP-Module-01","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madebypixel02%2FCPP-Module-01","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madebypixel02%2FCPP-Module-01/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madebypixel02%2FCPP-Module-01/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madebypixel02%2FCPP-Module-01/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madebypixel02","download_url":"https://codeload.github.com/madebypixel02/CPP-Module-01/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madebypixel02%2FCPP-Module-01/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30233432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42","42-cpp-module","42-cursus","42born2code","42madrid","42school","born2code","brain","cpp","makefile","peer2peer","zombie"],"created_at":"2024-11-14T18:18:49.688Z","updated_at":"2026-03-07T22:07:58.247Z","avatar_url":"https://github.com/madebypixel02.png","language":"C++","readme":"# CPP-Module-01 | 42 Madrid\n\n*BraiiiiiiinnnzzzZ 🧠*\n\n### Table of Contents\n\n- [Introduction](#introduction)\n- [ex00. BraiiiiiiinnnzzzZ](#ex00-braiiiiiiinnnzzzz)\n\t* [Example](#example)\n- [ex01. Moar brainz!](#ex01-moar-brainz)\n\t* [Example](#example-1)\n- [ex02. HI THIS IS BRAIN](#ex02-hi-this-is-brain)\n\t* [Example](#example-2)\n- [ex03. Unnecessary violence](#ex03-unnecessary-violence)\n\t* [Example](#example-3)\n- [ex04. Sed is for losers](#ex04-sed-is-for-losers)\n\t* [Example](#example-4)\n- [ex05. Karen 2.0](#ex05-karen-20)\n\t* [Example](#example-5)\n- [ex06. Karen-filter](#ex06-karen-filter)\n\t* [Example](#example-6)\n- [Installation](#installation)\n- [Summary](#summary)\n\n## Introduction\n\nThis second set of exercises is a bit more interesting. We'll be learning the basics of memory allocation in C++, references, pointers, and a rough look at switches.\n\n## ex00. BraiiiiiiinnnzzzZ\n\nThis first exercise asks us to simply create a bunch of classes with basic methods we will use in future exercises in the module. We must have two ways of allocating instances of the class: either on the stack or on the heap, and free the allocated space at the right time.\n\n### Example\n\nThis is an example output given my main.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/40824677/189330417-5b804e3f-5590-4b35-8a6a-a8f53e410bb6.png\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/40824677/189330643-ee7426d5-b49c-430f-a951-68b6e7969286.png\"\u003e\n\u003c/div\u003e\n\n## ex01. Moar brainz!\n\nThis second exercise consists of creating a method that will summon **N** zombies in one go, without naming each one of them. Then they all announce themselves and are properly destroyed.\n\n### Example\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/40824677/189332763-1d2836a5-2300-49a0-bdb0-57dbe5d9a3bd.png\"\u003e\n\u003c/div\u003e\n\n## ex02. HI THIS IS BRAIN\n\nThis next exercise is super simple, it only aims to differentiate between pointers and references\n\n### Example\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/40824677/189333500-6110f4ce-dbb5-4d0f-9729-49a13d47557d.png\"\u003e\n\u003c/div\u003e\n\n## ex03. Unnecessary violence\n\nThis one extends the concepts of references and pointers from the previous exercise, creating two types of humans in two classes that can attack each other with different weapons.\n\n### Example\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/40824677/189334239-fa95bba9-eaa3-41db-b834-8decbd2a3a89.png\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/40824677/189334016-a97f57c5-9bdb-40a0-a076-37d5a16a1eda.png\"\u003e\n\u003c/div\u003e\n\n## ex04. Sed is for losers\n\nThis exercise aims to replicate the basic performance of the **sed** command (**s**tream **ed**itor), receiving a file and a string to replace with another. It saves the output to a file with the same name ending in *.replace*. This exercise helps us understand file streams and strings in C++.\n\n### Example\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/40824677/189335320-92e905bb-e978-4b8d-859e-d87558ec481f.png\"\u003e\n\u003c/div\u003e\n\nNote: the example above shows how the replace operation is reversible (unsurprisingly).\n\n## ex05. Karen 2.0\n\nThe next two exercises expand on the idea of refernces a bit further. We create a **Karen** class that can give various messages of types **DEBUG**, **INFO**, **WARNING** and **ERROR**. We are asked to create that outputs the proper message depending message type.\n\n### Example\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/40824677/189336182-7321ad3f-8c24-40ad-8a80-de48ab11da1e.png\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/40824677/189335932-cc2a47f6-d0b1-4030-93ca-e714a4a2d6ab.png\"\u003e\n\u003c/div\u003e\n\n## ex06. Karen-filter\n\nThis last exercise is an extension of the previous one. However this time we receive the message type from the user and output that type's message and all the message types above it (order is **DEBUG** \u003c **INFO** \u003c **WARNING** \u003c **ERROR**). We must coordinate the responses using switches for this exercise.\n\n### Example\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/40824677/189337035-d77110f1-0bc6-4071-bb6c-249054d99982.png\"\u003e\n\u003c/div\u003e\n\nNote how the **DEBUG** message is not shown because it is below **INFO**.\n\n## Installation\n\nFor this project and fututre C++ projects it is only required to have `clang` and/or `gcc`, which provide their respective compilers `clang++` and `g++`. It is also recommended to install the `valgrind` package on **Linux** for debugging purposes. Every exercise (unless specified otherwise) includes its own Makefile with the necessary instructions. In some cases certain tweaks needed to be made to ensure the most similar results in both **Linux** and **MacOS**.\n\n## Summary\nThis one was definitely harder than the previous one, but it was still pretty fun.\n\nJune 13th, 2022\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadebypixel02%2Fcpp-module-01","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadebypixel02%2Fcpp-module-01","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadebypixel02%2Fcpp-module-01/lists"}