Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
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>net9.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>net9.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>net9.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>net9.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>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</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>net9.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>net9.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>net9.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>net9.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>net9.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>net9.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>net9.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>net9.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>net9.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>net9.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>net9.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>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
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>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion KnapsackGreedy/KnapsackGreedy/KnapsackGreedy.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>net9.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>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion LinkedList/LinkedList/LinkedList.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>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion MaxObjectSize/MaxObjectSize/MaxObjectSize.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>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Nasobky/Nasobky/Nasobky.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>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Palindrome/Palindrome/Palindrome.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>net9.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>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
Loading