-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inhaltliche Änderungen für den Vorkurs 2024 (#128)
* initial commit fuer eigen computer * added eigene computer part to main script * small ansible changes * updated readme #124 * Section für Windows leicht überarbeitet und aktualisiert auf WSL2. * Update build.yml Updated from upload-artifact@v2 to @v4, as @V3 will be deprecated as of Nov. 30 2024 (1,5months) * Windows section aktualisiert, hello world angepasst auf vscode * In Kapitel 10 werden jetzt for und while Loops vorgestellt. Außerdem wurden Aufgaben hinzugefügt um for-loops zu benutzen und einen for-loop in einen while-loop umzuwandeln * kleine rechtschreibkorrektur im diagramm * Dopplung entfernt * Kapitel Vektoren leicht überarbeitet: Einen while-loop durch einen for-loop ersetut, kleine aufgabenstellung hinzugefügt zur verhinderung von out-of bounce zugriffen. kleine fehlerkorrektur in prim-for-loop * preprocessing hinzugefügt * huch ist mir ein fehler durchgerutscht * added missing escape symbol * rechtschreibfehler korrigiert Co-authored-by: Christian Heusel <[email protected]> * clarification Co-authored-by: Christian Heusel <[email protected]> * Delete vorkurs_log.txt no idea why this got committed * renamed lesson 18 * of course i forgot to edit the script to include the new name for lesson 18 * Update basics/schleifen.tex * rechtschreibfehler und clion footnote hinzugefügt * Update hello_world.tex fix broken link --------- Co-authored-by: Felix <[email protected]> Co-authored-by: holyaltbier <[email protected]> Co-authored-by: Christian Heusel <[email protected]> Co-authored-by: Tim Grube <[email protected]> Co-authored-by: Felix Schledorn <[email protected]>
- Loading branch information
1 parent
01118c9
commit 7330fd9
Showing
18 changed files
with
245 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
\setcounter{chapter}{-1} | ||
\chapter{Vorbereitung eigener Computer} | ||
\pagestyle{empty} | ||
Dieses Kapitel dient der Vorbereitung privater Computer, um daran den Kurs zu bearbeiten. | ||
Wir werden in diesem Fall den proprietären Editor „Visual Studio Code“ verwenden, welcher \href{https://code.visualstudio.com/Download}{hier} heruntergeladen werden kann.\\ | ||
|
||
\pagestyle{fancy} | ||
\input{eigene_computer/windows.tex} | ||
\input{eigene_computer/macos.tex} | ||
\input{eigene_computer/linux.tex} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
\textbf{Linux} | ||
|
||
\pagestyle{empty} | ||
|
||
Falls ihr privat bereits ein Linux-System nutzt. | ||
\begin{enumerate} | ||
\item Optional: Alternativ zu Visual Studio Code, könnt ihr auch eine Quelloffene Version des Editors verwenden. | ||
Da die Installation dieser Version je nach Distribution variiert, verweisen wir euch an dieser Stelle an eine kurze Internetrecherche. | ||
\item Installiert mit eurem Packagemanager \texttt{g++} und ggf. \texttt{unzip}, sowie \texttt{wget}. | ||
\item Das Archiv mit den Vorkursdateien könnt ihr mit \\ | ||
\texttt{wget https://mathphys.info/vorkurs/pvk/vorkurs.zip} herunterladen. | ||
\item Mit \texttt{unzip vorkurs.zip} könnt ihr dieses entpacken. | ||
\end{enumerate} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
\textbf{MacOS} | ||
|
||
\pagestyle{empty} | ||
|
||
Das Setup unter MacOS ist im Vergleich zu Windows recht einfach. | ||
|
||
\begin{enumerate} | ||
\item Öffnet ein Terminal. | ||
\item Tippt \texttt{g++} ein. | ||
\item Bestätigt in dem erscheinenden Fenster die Installation. | ||
\item Die Dateien des Vorkurses können \href{https://mathphys.info/vorkurs/pvk/vorkurs.zip}{hier} heruntergeladen werden. | ||
\item Entpackt die Dateien in ein Verzeichnis eurer Wahl. | ||
\item In Visual Studio Code könnt ihr dann über den Explorer auf die Dateien des Kurses zugreifen. | ||
\end{enumerate} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
\textbf{Windows} | ||
|
||
\pagestyle{empty} | ||
Um dem Kurs unter Windows folgen zu können sollte zunächst eine Linux-Umgebung erzeugt werden, in der die entsprechenden Tools zur Verfügung stehen. Dafür muss zunächst das so genannte Windows-Subsystem für Linux (kurz WSL) aktiviert werden. | ||
Wie der Name bereits vermuten lässt, erlaubt es das WSL, eine Linux-Umgebung unter Windows zu nutzen. | ||
In dieser werden wir dann die nötigen Tools installieren. | ||
\begin{enumerate} | ||
\item Zunächst muss mittels PowerShell das WSL aktiviert werden. Dafür kann man im Suchfeld des Windows-Desktops einfach nach „PowerShell“ suchen. | ||
Durch einen Rechtsklick kann diese als Administrator gestartet werden, was für die Aktivierung notwendig ist. | ||
\item Hat man die PowerShell als Administrator geöffnet, kann das WSL durch den Befehl \texttt{wsl -{}-install} aktivieren. | ||
\item Das System startet danach einen Download, diesen durchlaufen lassen, und anschließend den PC neu starten. | ||
\item Nach dem Neustart kann in den Programmen „Ubuntu“ gestartet werden. | ||
Wenn ihr an dieser Stelle „Ubuntu“ nicht auswählen könnt, dann ist die Installation unter Umständen noch nicht fertig. | ||
Startet in diesem Fall die PowerShell erneut als Administrator und führt erneut \texttt{wsl -{}-install} aus. | ||
\item In dem erscheinenden Terminal wird zunächst um die Erstellung eines neuen Nutzers für die Linux-Umgebung gebeten. | ||
Hierbei könnt ihr Nutzername und Passwort frei wählen. Bitte notiert euch diese, da ihr sie noch braucht.\\ | ||
\textbf{Hinweis zum setzen des Passworts:} Anders als bei Windows werden hier bei der Eingabe keine Sternchen, oder ähnliche Symbole erscheinen, die als Platzhalter für bereits eingegebene Symbole erscheinen. | ||
Das Passwort muss also „blind“ eingegeben werden. Um hier ein eventuelles Vertippen auszuschließen, muss das Passwort nach der ersten Eingabe erneut bestätigt werden. | ||
\item Bevor ihr neue Tools installiert, solltet ihr euer System updaten. Gebt dazu ins Terminal folgende Befehle ein: \texttt{sudo apt update} und danach \texttt{sudo apt upgrade}. Im Allgemeinen empfiehlt es sich, diese Befehle im regelmäßigen Abstand auszuführen um euer System aktuell zu halten. Ihr werdet hier eventuell nach einem Passwort gefragt, ihr müsst hier das eben von euch gesetzte verwenden. | ||
\item Im Anschluss müssen im Terminal mittels \texttt{sudo apt install gdb g++ unzip -y} die nötigen Tools installiert werden. | ||
Der Start des Vorgangs muss dabei wieder mit dem vorhin gesetzten Passwort bestätigt werden. | ||
(Auch hier werden keine Sternchen oder Ähnliches für bereits eingegeben Symbole angezeigt) | ||
\item Jetzt könnt ihr die Dateien des Kurses mittels \\ | ||
\texttt{wget https://mathphys.info/vorkurs/pvk/vorkurs.zip} herunterladen. | ||
\item Abschließend könnt ihr das Archiv mit \texttt{unzip vorkurs.zip} entpacken. | ||
\item Die Dateien des Vorkurses können nun mittels \texttt{code vorkurs} über das Terminal geöffnet werden. | ||
\end{enumerate} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <iostream> | ||
|
||
int main() { | ||
int n; | ||
std::cout << "Gebe eine (positive) Zahl ein: "; | ||
std::cin >> n; | ||
|
||
if (n <= 0) { | ||
std::cerr << "Die Zahl soll positiv sein!" << std::endl; | ||
// Wir benutzen return, um unser Programm vorzeitig | ||
// abzubrechen. 1 bedeutet, dass ein Fehler aufgetreten | ||
// ist, 0 bedeutet, alles ist okay | ||
return 1; | ||
} | ||
|
||
bool hat_teiler = false; | ||
// Äquivaltent zu while (i < n) | ||
for (int i = 2; i < n; i++) { | ||
if ((n % i) == 0) { | ||
hat_teiler = true; | ||
} | ||
} | ||
|
||
if (hat_teiler) { | ||
std::cout << n << " ist keine Primzahl" << std::endl; | ||
} | ||
else { | ||
std::cout << n << " ist eine Primzahl" << std::endl; | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.