Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Continuous Integration

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: List all solutions
run: |
echo "Found the following solution files:"
find . \( -name "*.sln" -o -name "*.slnx" \) -type f | sort
echo "Total solutions: $(find . \( -name '*.sln' -o -name '*.slnx' \) -type f | wc -l)"

- name: Build all solutions
shell: bash
run: |
set -e
echo "Building all solutions in the repository..."

# Create arrays to track results
declare -a failed_solutions=()
declare -a successful_solutions=()

# Build each solution
while IFS= read -r solution; do
echo ""
echo "========================================"
echo "Building solution: $solution"
echo "========================================"

if dotnet build "$solution" --configuration Release --verbosity minimal; then
echo "βœ… Build successful for $solution"
successful_solutions+=("$solution")
else
echo "❌ Build failed for $solution"
failed_solutions+=("$solution")
fi
done < <(find . \( -name "*.sln" -o -name "*.slnx" \) -type f | sort)

# Print summary
echo ""
echo "========================================"
echo "BUILD SUMMARY"
echo "========================================"
echo "Total solutions: $((${#successful_solutions[@]} + ${#failed_solutions[@]}))"
echo "Successful builds: ${#successful_solutions[@]}"
echo "Failed builds: ${#failed_solutions[@]}"

if [ ${#failed_solutions[@]} -gt 0 ]; then
echo ""
echo "Failed solutions:"
for solution in "${failed_solutions[@]}"; do
echo " - $solution"
done
exit 1
else
echo ""
echo "πŸŽ‰ All solutions built successfully!"
fi
2 changes: 1 addition & 1 deletion BankingOop/BankingOop/BankingOop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion BankingOop2/BankingOop2/BankingOop2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Banking</RootNamespace>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion BinarySearchTree/BinarySearchTree/BinarySearchTree.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion BracesValidator/BracesValidator/BracesValidator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion CloveceNezlobSe/CloveceNezlobSe/CloveceNezlobSe.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Collatz/Collatz/Collatz.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion DatabaseConnector/DatabaseConnector/DatabaseConnector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
42 changes: 16 additions & 26 deletions DatabaseConnector/DatabaseConnector/Program.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
ο»Ώusing System;
using System.Data.SqlClient;

namespace DatabaseConnector
{
class Program
{
static void Main(string[] args)
{
using var conn = new SqlConnection("***");
conn.Open();
using var cmd = new SqlCommand("SELECT COUNT(*) FROM Zapisnik", conn);
Console.WriteLine(cmd.ExecuteScalar());
using var conn = new SqlConnection("***");
conn.Open();
using var cmd = new SqlCommand("SELECT COUNT(*) FROM Zapisnik", conn);
Console.WriteLine(cmd.ExecuteScalar());

cmd.CommandText = "INSERT INTO Zapisnik(Jmeno, Obsah) VALUES('PrvnΓ­ pokus', 'Hokus pokus')";
cmd.ExecuteNonQuery();
cmd.CommandText = "INSERT INTO Zapisnik(Jmeno, Obsah) VALUES('PrvnΓ­ pokus', 'Hokus pokus')";
cmd.ExecuteNonQuery();

cmd.CommandText = "SELECT COUNT(*) FROM Zapisnik";
Console.WriteLine(cmd.ExecuteScalar());
cmd.CommandText = "SELECT COUNT(*) FROM Zapisnik";
Console.WriteLine(cmd.ExecuteScalar());

using var cmd2 = new SqlCommand("SELECT TOP 10 * FROM Customer", conn);
using (var reader = cmd2.ExecuteReader())
{
while (reader.Read())
{
var firstName = reader["FirstName"];
var lastName = reader["LastName"];
using var cmd2 = new SqlCommand("SELECT TOP 10 * FROM Customer", conn);
using (var reader = cmd2.ExecuteReader())
{
while (reader.Read())
{
var firstName = reader["FirstName"];
var lastName = reader["LastName"];

Console.WriteLine($"Načten zÑkazník: {firstName} {lastName}");
}
}
}
Console.WriteLine($"Načten zÑkazník: {firstName} {lastName}");
}
}
2 changes: 1 addition & 1 deletion DigitalRoot/DigitalRoot/DigitalRoot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion DijkstraShortestPath/DijkstraShortestPath.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion DuplicateEncoder/DuplicateEncoder/DuplicateEncoder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
3 changes: 2 additions & 1 deletion FileReadWrite/FileReadWrite/FileReadWrite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion HadaniCisel/HadaniCisel/HadaniCisel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Hashtable/Hashtable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
3 changes: 2 additions & 1 deletion JackpotGame/JackpotGame/JackpotGame.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

</Project>
78 changes: 33 additions & 45 deletions JackpotGame/JackpotGame/Program.cs
Original file line number Diff line number Diff line change
@@ -1,55 +1,43 @@
ο»Ώusing System;
using System.Threading;
Console.Clear();
int score = 0;
int pokus = 0;

namespace JackpotGame
while (true)
{
class Program
{
static void Main(string[] args)
{
Console.Clear();
int score = 0;
int pokus = 0;

while (true)
{
int cislo1 = new Random().Next(10);
Console.SetCursorPosition(10, 10);
Console.Write(cislo1);
int cislo1 = new Random().Next(10);
Console.SetCursorPosition(10, 10);
Console.Write(cislo1);

int cislo2 = new Random().Next(10);
Console.SetCursorPosition(20, 10);
Console.Write(cislo2);
int cislo2 = new Random().Next(10);
Console.SetCursorPosition(20, 10);
Console.Write(cislo2);

int cislo3 = new Random().Next(10);
Console.SetCursorPosition(30, 10);
Console.Write(cislo3);
int cislo3 = new Random().Next(10);
Console.SetCursorPosition(30, 10);
Console.Write(cislo3);
Comment thread
hakenr marked this conversation as resolved.

if (Console.KeyAvailable)
{
Console.ReadKey();

pokus = pokus + 1;
if (Console.KeyAvailable)
{
Console.ReadKey();

if (cislo1 == cislo2)
{
score = score + 1;
}
if (cislo2 == cislo3)
{
score = score + 1;
}
if (cislo1 == cislo3)
{
score = score + 1;
}
pokus = pokus + 1;

Console.SetCursorPosition(1, 1);
Console.Write($"{score}/{pokus}");
Console.Beep();
Thread.Sleep(1000); // 1s
}
}
if (cislo1 == cislo2)
{
score = score + 1;
}
if (cislo2 == cislo3)
{
score = score + 1;
}
if (cislo1 == cislo3)
{
score = score + 1;
}

Console.SetCursorPosition(1, 1);
Console.Write($"{score}/{pokus}");
Console.Beep();
Thread.Sleep(1000); // 1s
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion KNearestNeighbors/KNearestNeighbors/Program.cs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ο»Ώ// TODO
ο»Ώ// TODO: Implement K-Nearest Neighbors algorithm
Console.WriteLine("TODO: K-Nearest Neighbors - not yet implemented.");
2 changes: 1 addition & 1 deletion KnapsackDynamic/KnapsackDynamic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
Loading
Loading