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

live14 alku

parent 33eabcc8
No related branches found
No related tags found
No related merge requests found
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
#endregion
namespace LaskeMatka
{
/// <summary>
/// The main class.
/// </summary>
public static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
using var game = new LaskeMatka();
game.Run();
}
}
}
\ No newline at end of file
using System;
/// @author Vesa Lappalainen
/// @version 23.10.2012
///
/// <summary>
/// Tutkitaan matriiseja
/// </summary>
public class Matriisit
{
/// <summary>
/// Tutkitaan matriiseja
/// </summary>
/// <param name="args">ei käytössä</param>
public static void Main(string[] args)
{
int[,] mat = {
{2,1,2},
{3,4,2},
{1,0,1},
{1,8,9}
};
// int[,] mat2 = new int[6, 5];
// mat[0, 0] = 2;
int lkm = 0; // MonellakoRivilla(mat, 5);
Console.WriteLine(lkm);
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ExternalConsole>true</ExternalConsole>
</PropertyGroup>
</Project>
using System;
// ReSharper disable all
public class Muuttujat
{
public static void Main(string[] args)
{
int[] t = { 3, 5, 9 };
Kasvata(t);
Console.WriteLine(String.Join(" ",t));
}
public static int Kasvata(int[] t)
{
int a = t[1];
t[2] = 5;
a = 7;
return t[0]-1;
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ExternalConsole>true</ExternalConsole>
</PropertyGroup>
</Project>

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AngryLego", "AngryLego\AngryLego.csproj", "{CA543AF2-84EB-4DE8-989C-4AFDCBD50B0C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Matriisit", "Matriisit\Matriisit.csproj", "{5ABDB4FD-1924-4E82-B02D-EA74C2FE56D4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Muuttujat", "Muuttujat\Muuttujat.csproj", "{136FC6FD-1DD1-4690-95D7-1E52651FC2BE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaskeMatka", "LaskeMatka\LaskeMatka.csproj", "{0753562C-41AC-479A-881D-7A4390164FE2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CA543AF2-84EB-4DE8-989C-4AFDCBD50B0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CA543AF2-84EB-4DE8-989C-4AFDCBD50B0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA543AF2-84EB-4DE8-989C-4AFDCBD50B0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA543AF2-84EB-4DE8-989C-4AFDCBD50B0C}.Release|Any CPU.Build.0 = Release|Any CPU
{5ABDB4FD-1924-4E82-B02D-EA74C2FE56D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5ABDB4FD-1924-4E82-B02D-EA74C2FE56D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5ABDB4FD-1924-4E82-B02D-EA74C2FE56D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5ABDB4FD-1924-4E82-B02D-EA74C2FE56D4}.Release|Any CPU.Build.0 = Release|Any CPU
{136FC6FD-1DD1-4690-95D7-1E52651FC2BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{136FC6FD-1DD1-4690-95D7-1E52651FC2BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{136FC6FD-1DD1-4690-95D7-1E52651FC2BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{136FC6FD-1DD1-4690-95D7-1E52651FC2BE}.Release|Any CPU.Build.0 = Release|Any CPU
{0753562C-41AC-479A-881D-7A4390164FE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0753562C-41AC-479A-881D-7A4390164FE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0753562C-41AC-479A-881D-7A4390164FE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0753562C-41AC-479A-881D-7A4390164FE2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
...@@ -36,7 +36,7 @@ public class LaskeMatka : PhysicsGame ...@@ -36,7 +36,7 @@ public class LaskeMatka : PhysicsGame
private readonly List<Vector> pisteet = new List<Vector>(); // listalle private readonly List<Vector> pisteet = new List<Vector>(); // listalle
private readonly DoubleMeter yhteismatka = new DoubleMeter(200); private readonly DoubleMeter yhteismatka = new DoubleMeter(200);
private Label matkanytto; private Label matkanaytto;
public override void Begin() public override void Begin()
{ {
...@@ -48,11 +48,11 @@ public class LaskeMatka : PhysicsGame ...@@ -48,11 +48,11 @@ public class LaskeMatka : PhysicsGame
klikattuPiste = LuoPallo(this, Vector.Zero, 1.5 * pallonKoko, Color.Blue); klikattuPiste = LuoPallo(this, Vector.Zero, 1.5 * pallonKoko, Color.Blue);
matkanytto = new Label("0.0"); matkanaytto = new Label("0.0");
matkanytto.BindTo(yhteismatka); matkanaytto.BindTo(yhteismatka);
Add(matkanytto); Add(matkanaytto);
matkanytto.Position = new Vector(400, 300); matkanaytto.Position = new Vector(400, 300);
matkanytto.DoubleFormatString = "{0:0.000} m"; matkanaytto.DoubleFormatString = "{0:0.000} m";
AsetaOhjaimet(); AsetaOhjaimet();
Camera.ZoomTo(x1, y1, x2, y2); Camera.ZoomTo(x1, y1, x2, y2);
...@@ -141,7 +141,7 @@ public class LaskeMatka : PhysicsGame ...@@ -141,7 +141,7 @@ public class LaskeMatka : PhysicsGame
private void PoistaPisteet() private void PoistaPisteet()
{ {
ClearGameObjects(); ClearGameObjects();
Add(matkanytto); Add(matkanaytto);
// pisteet = new Vector[100]; lkm = 0; // taulukolle // pisteet = new Vector[100]; lkm = 0; // taulukolle
pisteet.RemoveRange(0, pisteet.Count); // listalle pisteet.RemoveRange(0, pisteet.Count); // listalle
......
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