diff --git a/luennot/live19/.idea/.idea.live19/.idea/.gitignore b/luennot/live19/.idea/.idea.live19/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e7d5486eae5cd613d5a785255c7210547ffdf98e --- /dev/null +++ b/luennot/live19/.idea/.idea.live19/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/modules.xml +/.idea.live19.iml +/projectSettingsUpdater.xml +/contentModel.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/luennot/live19/.idea/.idea.live19/.idea/encodings.xml b/luennot/live19/.idea/.idea.live19/.idea/encodings.xml new file mode 100644 index 0000000000000000000000000000000000000000..df87cf951fb4858ab7a76b68dd479c98b2df2404 --- /dev/null +++ b/luennot/live19/.idea/.idea.live19/.idea/encodings.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" /> +</project> \ No newline at end of file diff --git a/luennot/live19/.idea/.idea.live19/.idea/indexLayout.xml b/luennot/live19/.idea/.idea.live19/.idea/indexLayout.xml new file mode 100644 index 0000000000000000000000000000000000000000..7b08163cebc50fb3e777eea4881b68fcebc10590 --- /dev/null +++ b/luennot/live19/.idea/.idea.live19/.idea/indexLayout.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="UserContentModel"> + <attachedFolders /> + <explicitIncludes /> + <explicitExcludes /> + </component> +</project> \ No newline at end of file diff --git a/luennot/live19/.idea/.idea.live19/.idea/vcs.xml b/luennot/live19/.idea/.idea.live19/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..b2bdec2d71b6a5ce4ae49efc37516809c50e4d5e --- /dev/null +++ b/luennot/live19/.idea/.idea.live19/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$/../.." vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/luennot/live19/Rekursio/Rekursio.cs b/luennot/live19/Rekursio/Rekursio.cs new file mode 100644 index 0000000000000000000000000000000000000000..8e40b4e9fba1ad757428685f9bfe1638d430b306 --- /dev/null +++ b/luennot/live19/Rekursio/Rekursio.cs @@ -0,0 +1,56 @@ +using System; +using System.Text; +using System.Linq; +using System.Collections.Generic; + +/// @author Omanimi +/// @version 06.11.2023 +/// <summary> +/// +/// </summary> +public class Rekursio +{ + /// <summary> + /// + /// </summary> + public static void Main() + { + long tulos = Kertoma(4); // 52! = 8 10¨68 + // long tulosf = KertomaFor(4); + System.Console.WriteLine(tulos); + } + + + /// <example> + /// <pre name="test"> + /// Kertoma(0) === 1L; + /// Kertoma(1) === 1L; + /// Kertoma(2) === 2L; + /// Kertoma(5) === 120L; + /// Kertoma(6) === 720L; + /// </pre> + /// </example> + public static long Kertoma(long n) + { + if (n <= 1L) return 1L; + return n * Kertoma(n - 1); + } + + + /// <example> + /// <pre name="test"> + /// KertomaFor(0) === 1L; + /// KertomaFor(1) === 1L; + /// KertomaFor(2) === 2L; + /// KertomaFor(5) === 120L; + /// KertomaFor(6) === 720L; + /// </pre> + /// </example> + public static long KertomaFor(long n) + { + long tulos = 1L; + for (int i = 1; i <= n; i++) tulos *= i; + return tulos; + } + +} \ No newline at end of file diff --git a/luennot/live19/Rekursio/Rekursio.csproj b/luennot/live19/Rekursio/Rekursio.csproj new file mode 100644 index 0000000000000000000000000000000000000000..df22a1ba07d539b07cf0adbaa6457daadeb433db --- /dev/null +++ b/luennot/live19/Rekursio/Rekursio.csproj @@ -0,0 +1,9 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>net7.0</TargetFramework> + <ExternalConsole>true</ExternalConsole> + </PropertyGroup> + +</Project> diff --git a/luennot/live19/RekursioTest/RekursioTest.cs b/luennot/live19/RekursioTest/RekursioTest.cs new file mode 100644 index 0000000000000000000000000000000000000000..ccf49e0619f1a3fbaa3d78c0d55f16f528996c1c --- /dev/null +++ b/luennot/live19/RekursioTest/RekursioTest.cs @@ -0,0 +1,32 @@ +// ReSharper disable all +using System; +using System.Text; +using System.Linq; +using System.Collections.Generic; +using NUnit.Framework; +using static Rekursio; + + [TestFixture] + [DefaultFloatingPointTolerance(0.000001)] + public class TestRekursio + { + [Test] + public void TestKertoma25() + { + Assert.AreEqual( 1L, Kertoma(0) , "in method Kertoma, line 26"); + Assert.AreEqual( 1L, Kertoma(1) , "in method Kertoma, line 27"); + Assert.AreEqual( 2L, Kertoma(2) , "in method Kertoma, line 28"); + Assert.AreEqual( 120L, Kertoma(5) , "in method Kertoma, line 29"); + Assert.AreEqual( 720L, Kertoma(6) , "in method Kertoma, line 30"); + } + [Test] + public void TestKertomaFor41() + { + Assert.AreEqual( 1L, KertomaFor(0) , "in method KertomaFor, line 42"); + Assert.AreEqual( 1L, KertomaFor(1) , "in method KertomaFor, line 43"); + Assert.AreEqual( 2L, KertomaFor(2) , "in method KertomaFor, line 44"); + Assert.AreEqual( 120L, KertomaFor(5) , "in method KertomaFor, line 45"); + Assert.AreEqual( 720L, KertomaFor(6) , "in method KertomaFor, line 46"); + } + } + diff --git a/luennot/live19/RekursioTest/RekursioTest.csproj b/luennot/live19/RekursioTest/RekursioTest.csproj new file mode 100644 index 0000000000000000000000000000000000000000..45ebab88d4016ca288f44a79bbae404f93ce9214 --- /dev/null +++ b/luennot/live19/RekursioTest/RekursioTest.csproj @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Project Sdk="Microsoft.NET.Sdk"> + <PropertyGroup> + <TargetFramework>net7.0</TargetFramework> + <IsPackable>false</IsPackable> + </PropertyGroup> + <ItemGroup> + <PackageReference Include="NUnit" Version="3.13.1"/> + <PackageReference Include="NUnit3TestAdapter" Version="3.17.0"/> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3"/> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Rekursio\Rekursio.csproj"/> + </ItemGroup> +</Project> diff --git a/luennot/live19/live19.sln b/luennot/live19/live19.sln new file mode 100644 index 0000000000000000000000000000000000000000..07a0f30ad0073ba36252e823cba51cfa10e2eaa6 --- /dev/null +++ b/luennot/live19/live19.sln @@ -0,0 +1,23 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 + +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rekursio", "Rekursio\Rekursio.csproj", "{874F3A3C-FC86-4A53-B0F9-BDA00AA96F4D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RekursioTest", "RekursioTest\RekursioTest.csproj", "{814FF6BD-D07E-4CC7-861D-AD17131F5E9C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {874F3A3C-FC86-4A53-B0F9-BDA00AA96F4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {874F3A3C-FC86-4A53-B0F9-BDA00AA96F4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {874F3A3C-FC86-4A53-B0F9-BDA00AA96F4D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {874F3A3C-FC86-4A53-B0F9-BDA00AA96F4D}.Release|Any CPU.Build.0 = Release|Any CPU + {814FF6BD-D07E-4CC7-861D-AD17131F5E9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {814FF6BD-D07E-4CC7-861D-AD17131F5E9C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {814FF6BD-D07E-4CC7-861D-AD17131F5E9C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {814FF6BD-D07E-4CC7-861D-AD17131F5E9C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/luennot/live19/live19.sln.ctbackup b/luennot/live19/live19.sln.ctbackup new file mode 100644 index 0000000000000000000000000000000000000000..f7419247f3af017f72bcf16b01ad4f0c81680861 --- /dev/null +++ b/luennot/live19/live19.sln.ctbackup @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rekursio", "Rekursio\Rekursio.csproj", "{874F3A3C-FC86-4A53-B0F9-BDA00AA96F4D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {874F3A3C-FC86-4A53-B0F9-BDA00AA96F4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {874F3A3C-FC86-4A53-B0F9-BDA00AA96F4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {874F3A3C-FC86-4A53-B0F9-BDA00AA96F4D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {874F3A3C-FC86-4A53-B0F9-BDA00AA96F4D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/luennot/live20/.idea/.idea.live20/.idea/.gitignore b/luennot/live20/.idea/.idea.live20/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5aeb824a3b2209d17b4ce134de317b218c28f17e --- /dev/null +++ b/luennot/live20/.idea/.idea.live20/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/contentModel.xml +/projectSettingsUpdater.xml +/modules.xml +/.idea.live20.iml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/luennot/live20/.idea/.idea.live20/.idea/encodings.xml b/luennot/live20/.idea/.idea.live20/.idea/encodings.xml new file mode 100644 index 0000000000000000000000000000000000000000..df87cf951fb4858ab7a76b68dd479c98b2df2404 --- /dev/null +++ b/luennot/live20/.idea/.idea.live20/.idea/encodings.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" /> +</project> \ No newline at end of file diff --git a/luennot/live20/.idea/.idea.live20/.idea/indexLayout.xml b/luennot/live20/.idea/.idea.live20/.idea/indexLayout.xml new file mode 100644 index 0000000000000000000000000000000000000000..7b08163cebc50fb3e777eea4881b68fcebc10590 --- /dev/null +++ b/luennot/live20/.idea/.idea.live20/.idea/indexLayout.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="UserContentModel"> + <attachedFolders /> + <explicitIncludes /> + <explicitExcludes /> + </component> +</project> \ No newline at end of file diff --git a/luennot/live20/.idea/.idea.live20/.idea/vcs.xml b/luennot/live20/.idea/.idea.live20/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..b2bdec2d71b6a5ce4ae49efc37516809c50e4d5e --- /dev/null +++ b/luennot/live20/.idea/.idea.live20/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$/../.." vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/luennot/live20/Poikkeus/Poikkeus.cs b/luennot/live20/Poikkeus/Poikkeus.cs new file mode 100644 index 0000000000000000000000000000000000000000..a8a4690225d4b919784e0933e384a73cf791bd70 --- /dev/null +++ b/luennot/live20/Poikkeus/Poikkeus.cs @@ -0,0 +1,84 @@ +using System; + +/// @author Vesa Lappalainen +/// @version 10.11.2020 +/// <summary> +/// Tutkitaan poikkeuksia +/// </summary> +public class Poikkeus +{ + /// <summary> + /// Esimerkkejä poikkeuksista + /// </summary> + public static void Main() + { + int[] luvut = { 2, 4, 1 }; + /* + luvut = new int[3]; // täynnä 0:ia + luvut[0] = 2; + luvut[1] = 4; + luvut[2] = 1; + */ + + int a1 = 3, a2 = 4, a3 = 1, a4 = 7; + + try + { + int s = Summa(luvut, 0, 4); + Console.WriteLine(s); + Console.WriteLine(10 / a1); + Console.WriteLine(10 / a2); + Console.WriteLine(10 / a3); + Console.WriteLine(10 / a4); + } + catch (DivideByZeroException ex) + { + Console.WriteLine("Jaoit nollalla aasi! " + ex.Message); + } + /* + catch (IndexOutOfRangeException ex) + { + Console.WriteLine(ex.Message); + } + */ + } + + + /// <summary> + /// Lasketaan lukujen summa taulukon osajoukosta + /// </summary> + /// <param name="luvut">taulukko, jonka lukujen summa lasketaan</param> + /// <param name="alku">indeksi josta summaaminen aloitetaan</param> + /// <param name="loppu">loppuindeksi joka otetaan mukaan, -1 = taulukon loppuun</param> + /// <returns>taulukon osajoukon summa</returns> + /// <example> + /// <pre name="test"> + /// int[] luvut = { 2, 4, 1 }; + /// Summa(luvut) === 7; + /// Summa(luvut,0,2) === 7; + /// Summa(luvut,1,2) === 5; + /// Summa(luvut,1) === 5; + /// Summa(luvut,0,1) === 6; + /// Summa(luvut,1,1) === 4; + /// Summa(luvut,1,0) === 0; + /// Summa(luvut,0,100) === 7; #THROWS IndexOutOfRangeException + /// Summa(luvut,-4,100) === 7; #THROWS IndexOutOfRangeException + /// </pre> + /// </example> + public static int Summa(int[] luvut, int alku = 0, int loppu = -1) + { + int tulos = 0; + if (loppu == -1) loppu = luvut.Length - 1; + // Seuraavat voisi olla oikeasti järkeviä, mutta tässä harjoitellaan + // sitä, että poikkeus päästetään kutsuvaan ohjelmaan. + // if (loppu >= luvut.Length) loppu = luvut.Length - 1; + // if (alku < 0) alku = 0; + for (int i = alku; i <= loppu; i++) + { + int luku = luvut[i]; + tulos += luku; // tulos = tulos + luku; + } + + return tulos; + } +} \ No newline at end of file diff --git a/luennot/live20/Poikkeus/Poikkeus.csproj b/luennot/live20/Poikkeus/Poikkeus.csproj new file mode 100644 index 0000000000000000000000000000000000000000..df22a1ba07d539b07cf0adbaa6457daadeb433db --- /dev/null +++ b/luennot/live20/Poikkeus/Poikkeus.csproj @@ -0,0 +1,9 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>net7.0</TargetFramework> + <ExternalConsole>true</ExternalConsole> + </PropertyGroup> + +</Project> diff --git a/luennot/live20/Poistot/Poistot.cs b/luennot/live20/Poistot/Poistot.cs new file mode 100644 index 0000000000000000000000000000000000000000..949f3214ae342f241affe3591ed34d65440d4dab --- /dev/null +++ b/luennot/live20/Poistot/Poistot.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +/// @author Omanimi +/// @version 07.11.2023 +/// <summary> +/// +/// </summary> +public class Poistot +{ + /// <summary> + /// + /// </summary> + public static void Main() + { + List<string> sanat = new List<string>(){ "", "kissa", "kissa", "koira", "kana", "susi", "ankka" }; + + // PoistaSanat(sanat, "kissa"); + string poistettava = "kissa"; + + //sanat.RemoveAll(sana => sana == "kissa"); + Console.WriteLine(String.Join(", ", sanat)); + poistettava = "koira"; + sanat.RemoveAll(delegate(string sana) { if (sana.Length == 0) return false; return sana[0] == 'k';}); + Console.WriteLine(String.Join(", ", sanat)); + } + + public static bool AlkaaKlla(string sana) + { + if (sana.Length == 0) return false; + return sana[0] == 'k'; + } + + + public static List<string> PoistaSanat(List<string> sanat, string poistettava) + { + while (sanat.Remove(poistettava)) ; + return sanat; + } + + +} diff --git a/luennot/live20/Poistot/Poistot.csproj b/luennot/live20/Poistot/Poistot.csproj new file mode 100644 index 0000000000000000000000000000000000000000..df22a1ba07d539b07cf0adbaa6457daadeb433db --- /dev/null +++ b/luennot/live20/Poistot/Poistot.csproj @@ -0,0 +1,9 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>net7.0</TargetFramework> + <ExternalConsole>true</ExternalConsole> + </PropertyGroup> + +</Project> diff --git a/luennot/live20/live20.sln b/luennot/live20/live20.sln new file mode 100644 index 0000000000000000000000000000000000000000..0483249bf32cbca764cacbce4cc84de3a0653d8d --- /dev/null +++ b/luennot/live20/live20.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Poistot", "Poistot\Poistot.csproj", "{7FCEEA19-68B4-4A6C-8E5F-233154B9A213}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Poikkeus", "Poikkeus\Poikkeus.csproj", "{E0C65815-A9AC-457C-B38F-F6E5C13882B6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7FCEEA19-68B4-4A6C-8E5F-233154B9A213}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7FCEEA19-68B4-4A6C-8E5F-233154B9A213}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7FCEEA19-68B4-4A6C-8E5F-233154B9A213}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7FCEEA19-68B4-4A6C-8E5F-233154B9A213}.Release|Any CPU.Build.0 = Release|Any CPU + {E0C65815-A9AC-457C-B38F-F6E5C13882B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0C65815-A9AC-457C-B38F-F6E5C13882B6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0C65815-A9AC-457C-B38F-F6E5C13882B6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0C65815-A9AC-457C-B38F-F6E5C13882B6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/luennot/luento19/.idea/.idea.luento19/.idea/.gitignore b/luennot/luento19/.idea/.idea.luento19/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3693b5066f55addc5ef14ffeaeedd7c94523ddd4 --- /dev/null +++ b/luennot/luento19/.idea/.idea.luento19/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/modules.xml +/contentModel.xml +/projectSettingsUpdater.xml +/.idea.luento19.iml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/luennot/luento19/.idea/.idea.luento19/.idea/encodings.xml b/luennot/luento19/.idea/.idea.luento19/.idea/encodings.xml new file mode 100644 index 0000000000000000000000000000000000000000..df87cf951fb4858ab7a76b68dd479c98b2df2404 --- /dev/null +++ b/luennot/luento19/.idea/.idea.luento19/.idea/encodings.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" /> +</project> \ No newline at end of file diff --git a/luennot/luento19/.idea/.idea.luento19/.idea/indexLayout.xml b/luennot/luento19/.idea/.idea.luento19/.idea/indexLayout.xml new file mode 100644 index 0000000000000000000000000000000000000000..7b08163cebc50fb3e777eea4881b68fcebc10590 --- /dev/null +++ b/luennot/luento19/.idea/.idea.luento19/.idea/indexLayout.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="UserContentModel"> + <attachedFolders /> + <explicitIncludes /> + <explicitExcludes /> + </component> +</project> \ No newline at end of file diff --git a/luennot/luento19/.idea/.idea.luento19/.idea/vcs.xml b/luennot/luento19/.idea/.idea.luento19/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..b2bdec2d71b6a5ce4ae49efc37516809c50e4d5e --- /dev/null +++ b/luennot/luento19/.idea/.idea.luento19/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$/../.." vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/luennot/luento20/.idea/.idea.luento20/.idea/.gitignore b/luennot/luento20/.idea/.idea.luento20/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0c4f3e09d71004378b8cb59b5e1fe830bf35cf1d --- /dev/null +++ b/luennot/luento20/.idea/.idea.luento20/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/projectSettingsUpdater.xml +/contentModel.xml +/.idea.luento20.iml +/modules.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/luennot/luento20/.idea/.idea.luento20/.idea/encodings.xml b/luennot/luento20/.idea/.idea.luento20/.idea/encodings.xml new file mode 100644 index 0000000000000000000000000000000000000000..df87cf951fb4858ab7a76b68dd479c98b2df2404 --- /dev/null +++ b/luennot/luento20/.idea/.idea.luento20/.idea/encodings.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" /> +</project> \ No newline at end of file diff --git a/luennot/luento20/.idea/.idea.luento20/.idea/indexLayout.xml b/luennot/luento20/.idea/.idea.luento20/.idea/indexLayout.xml new file mode 100644 index 0000000000000000000000000000000000000000..7b08163cebc50fb3e777eea4881b68fcebc10590 --- /dev/null +++ b/luennot/luento20/.idea/.idea.luento20/.idea/indexLayout.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="UserContentModel"> + <attachedFolders /> + <explicitIncludes /> + <explicitExcludes /> + </component> +</project> \ No newline at end of file diff --git a/luennot/luento20/.idea/.idea.luento20/.idea/vcs.xml b/luennot/luento20/.idea/.idea.luento20/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..b2bdec2d71b6a5ce4ae49efc37516809c50e4d5e --- /dev/null +++ b/luennot/luento20/.idea/.idea.luento20/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$/../.." vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/luennot/luento20/TiedostoIsoksi/TiedostoIsoksi.cs b/luennot/luento20/TiedostoIsoksi/TiedostoIsoksi.cs index 94c0809b94e7017bd2955fe277007aaae4fd95cb..f08e3a8519fc6d0b6acd328c5f82c4535d5484b3 100644 --- a/luennot/luento20/TiedostoIsoksi/TiedostoIsoksi.cs +++ b/luennot/luento20/TiedostoIsoksi/TiedostoIsoksi.cs @@ -33,9 +33,13 @@ public class TiedostoIsoksi } catch (System.IO.FileNotFoundException ex) { - Console.WriteLine("Ei oo tiedostoo! " + ex.Message); + Console.WriteLine("Ei oo tiedostoo! " + nimi); return; } + finally + { + Console.WriteLine("Tällä ollaan"); + } }