Skip to content

Commit 74ee1c0

Browse files
style: format LICENSE
1 parent 3b031dc commit 74ee1c0

54 files changed

Lines changed: 753 additions & 3 deletions

Some content is hidden

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

LICENSE

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
Copyright (c) 2025 nooneknowspeter
22

3-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7+
of the Software, and to permit persons to whom the Software is furnished to do
8+
so, subject to the following conditions:
49

5-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
612

7-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// TODO: lambdas
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <iostream>
2+
3+
int max(int a, int b)
4+
{
5+
if (a > b)
6+
return a;
7+
else
8+
return b;
9+
}
10+
11+
void controlFlow01()
12+
{
13+
std::cout << max(3, 7) << "\n"; // 7
14+
std::cout << max(10, 4) << "\n"; // 10
15+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#include <iostream>
2+
#include <string>
3+
4+
std::string weekday(int day)
5+
{
6+
switch (day)
7+
{
8+
case 1:
9+
return "Monday";
10+
case 2:
11+
return "Tuesday";
12+
case 3:
13+
return "Wednesday";
14+
case 4:
15+
return "Thursday";
16+
case 5:
17+
return "Friday";
18+
case 6:
19+
return "Saturday";
20+
case 7:
21+
return "Sunday";
22+
default:
23+
return "Invalid";
24+
}
25+
}
26+
27+
void controlFlow02()
28+
{
29+
std::cout << weekday(1) << "\n";
30+
std::cout << weekday(5) << "\n";
31+
std::cout << weekday(9) << "\n";
32+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <iostream>
2+
3+
void controlFlow03()
4+
{
5+
for (int i = 1; i <= 5; ++i)
6+
std::cout << i << " ";
7+
std::cout << "\n";
8+
9+
int n = 5;
10+
while (n--)
11+
std::cout << "tick ";
12+
std::cout << "\n";
13+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// TODO: while
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// TODO: tenary operators
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <iostream>
2+
3+
void primitive01()
4+
{
5+
int i{42};
6+
double d{3.14};
7+
bool b{false};
8+
char ch{'z'};
9+
10+
std::cout << i << " " << d << " " << b << " " << ch << "\n";
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <iostream>
2+
#include <limits>
3+
4+
void primitives02()
5+
{
6+
std::cout << "int min=" << std::numeric_limits<int>::min() << " max=" << std::numeric_limits<int>::max() << "\n";
7+
std::cout << "double min=" << std::numeric_limits<double>::lowest() << " max=" << std::numeric_limits<double>::max()
8+
<< "\n";
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <iostream>
2+
3+
void primitives3()
4+
{
5+
auto hex = 0x2A; // 42
6+
auto bin = 0b101010; // 42
7+
auto oct = 052; // 42
8+
auto f = 3.14f; // float
9+
std::cout << hex << " " << bin << " " << oct << " " << f << "\n";
10+
}

0 commit comments

Comments
 (0)