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.Text;
using System.Linq;
using System.Collections.Generic;
/// @author vesal
/// @version 29.9.2013
......@@ -74,6 +71,7 @@ public class Tauno4
}
// ReSharper disable once ForCanBeConvertedToForeach
/// <summary>
/// Laskee yhteen taulukon alkiot
/// </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.Text;
using System.Linq;
using System.Collections.Generic;
/// @author vesal
/// @version 6.10.2013
......@@ -40,7 +37,7 @@ public class Tauno5
/// </example>
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.Text;
using System.Linq;
using System.Collections.Generic;
/// @author vesal
/// @version 15.10.2013
......@@ -36,7 +33,7 @@ public class Tauno6
/// </example>
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>
......@@ -52,6 +49,6 @@ public class Tauno6
/// </example>
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
/// </summary>
public class Piste
{
private Vector vektori;
public String nimi = "";
public String vari = "";
private readonly Vector vektori;
public string nimi = "";
public string vari = "";
/// <summary>
......@@ -186,7 +186,7 @@ namespace MinJypeli
/// </summary>
public static class RandomGen
{
private static Random rand = new Random();
private static readonly Random rand = new Random();
/// <summary>
/// Palauttaa satunnaisen liukuluvun parametrien <code>min</code> ja <code>max</code> väliltä.
......@@ -214,7 +214,7 @@ namespace MinJypeli
}
}
public struct Vector
public readonly struct Vector
{
/// <summary>
/// Nollavektori.
......@@ -233,24 +233,18 @@ namespace MinJypeli
return Math.Sqrt((x * x + y * y));
}
public double X;
public double Y;
public readonly double X;
public readonly double Y;
/// <summary>
/// Vektorin pituus.
/// </summary>
public double Magnitude
{
get { return Math.Sqrt(MagnitudeSquared); }
}
public double Magnitude => Math.Sqrt(MagnitudeSquared);
/// <summary>
/// Vektorin pituuden neliö.
/// </summary>
public double MagnitudeSquared
{
get { return X * X + Y * Y; }
}
public double MagnitudeSquared => X * X + Y * Y;
/// <summary>
/// Luo uuden vektorin komponenteista.
......@@ -270,7 +264,7 @@ namespace MinJypeli
/// <returns>lukupari merkkijonona</returns>
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