Skip to content
Snippets Groups Projects
Commit aa82c006 authored by Vesa Lappalainen's avatar Vesa Lappalainen :bicyclist:
Browse files

rider varoitukset pois

parent ced6f5f5
No related branches found
No related tags found
No related merge requests found
Showing
with 76 additions and 28 deletions
using System; using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;
/// @author vesal /// @author vesal
/// @version 29.9.2013 /// @version 29.9.2013
...@@ -74,6 +71,7 @@ public class Tauno4 ...@@ -74,6 +71,7 @@ public class Tauno4
} }
// ReSharper disable once ForCanBeConvertedToForeach
/// <summary> /// <summary>
/// Laskee yhteen taulukon alkiot /// Laskee yhteen taulukon alkiot
/// </summary> /// </summary>
......
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/contentModel.xml
/.idea.demo5.iml
/projectSettingsUpdater.xml
/modules.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?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
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>
\ No newline at end of file
<?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
using System; using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;
/// @author vesal /// @author vesal
/// @version 6.10.2013 /// @version 6.10.2013
...@@ -40,7 +37,7 @@ public class Tauno5 ...@@ -40,7 +37,7 @@ public class Tauno5
/// </example> /// </example>
public static void LisaaJuokseva(int[] t) public static void LisaaJuokseva(int[] t)
{ {
/// TODO: Kopioi tähän Taunossa tekemäsi koodi // TODO: Kopioi tähän Taunossa tekemäsi koodi
} }
} }
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/contentModel.xml
/projectSettingsUpdater.xml
/modules.xml
/.idea.demo6.iml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?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
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>
\ No newline at end of file
<?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
using System; using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;
/// @author vesal /// @author vesal
/// @version 15.10.2013 /// @version 15.10.2013
...@@ -36,7 +33,7 @@ public class Tauno6 ...@@ -36,7 +33,7 @@ public class Tauno6
/// </example> /// </example>
public static void KaannaTaulukko(int[] t) public static void KaannaTaulukko(int[] t)
{ {
/// TODO: Kopioi tähän Taunossa tekemäsi koodi // TODO: Kopioi tähän Taunossa tekemäsi koodi
} }
/// <summary> /// <summary>
...@@ -52,6 +49,6 @@ public class Tauno6 ...@@ -52,6 +49,6 @@ public class Tauno6
/// </example> /// </example>
public static void VaihdaJokaToinen(int[] t) public static void VaihdaJokaToinen(int[] t)
{ {
/// TODO: Kopioi tähän Taunossa tekemäsi koodi // TODO: Kopioi tähän Taunossa tekemäsi koodi
} }
} }
\ No newline at end of file
...@@ -126,9 +126,9 @@ namespace MinJypeli ...@@ -126,9 +126,9 @@ namespace MinJypeli
/// </summary> /// </summary>
public class Piste public class Piste
{ {
private Vector vektori; private readonly Vector vektori;
public String nimi = ""; public string nimi = "";
public String vari = ""; public string vari = "";
/// <summary> /// <summary>
...@@ -186,7 +186,7 @@ namespace MinJypeli ...@@ -186,7 +186,7 @@ namespace MinJypeli
/// </summary> /// </summary>
public static class RandomGen public static class RandomGen
{ {
private static Random rand = new Random(); private static readonly Random rand = new Random();
/// <summary> /// <summary>
/// Palauttaa satunnaisen liukuluvun parametrien <code>min</code> ja <code>max</code> väliltä. /// Palauttaa satunnaisen liukuluvun parametrien <code>min</code> ja <code>max</code> väliltä.
...@@ -214,7 +214,7 @@ namespace MinJypeli ...@@ -214,7 +214,7 @@ namespace MinJypeli
} }
} }
public struct Vector public readonly struct Vector
{ {
/// <summary> /// <summary>
/// Nollavektori. /// Nollavektori.
...@@ -233,24 +233,18 @@ namespace MinJypeli ...@@ -233,24 +233,18 @@ namespace MinJypeli
return Math.Sqrt((x * x + y * y)); return Math.Sqrt((x * x + y * y));
} }
public double X; public readonly double X;
public double Y; public readonly double Y;
/// <summary> /// <summary>
/// Vektorin pituus. /// Vektorin pituus.
/// </summary> /// </summary>
public double Magnitude public double Magnitude => Math.Sqrt(MagnitudeSquared);
{
get { return Math.Sqrt(MagnitudeSquared); }
}
/// <summary> /// <summary>
/// Vektorin pituuden neliö. /// Vektorin pituuden neliö.
/// </summary> /// </summary>
public double MagnitudeSquared public double MagnitudeSquared => X * X + Y * Y;
{
get { return X * X + Y * Y; }
}
/// <summary> /// <summary>
/// Luo uuden vektorin komponenteista. /// Luo uuden vektorin komponenteista.
...@@ -270,7 +264,7 @@ namespace MinJypeli ...@@ -270,7 +264,7 @@ namespace MinJypeli
/// <returns>lukupari merkkijonona</returns> /// <returns>lukupari merkkijonona</returns>
public override string ToString() public override string ToString()
{ {
return String.Format("({0:0.0},{1:0.0})", X, Y); return $"({X:0.0},{Y:0.0})";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment