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

luento05

parent 7761e4c0
No related branches found
No related tags found
No related merge requests found
Showing
with 213 additions and 410 deletions
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/projectSettingsUpdater.xml
/.idea.luento04.iml
/modules.xml
/contentModel.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
luennot/luento04/LumiukkoAli/LumiukkoAli/Game.ico

4.19 KiB

luennot/luento04/LumiukkoAli/LumiukkoAli/GameThumbnail.png

5.6 KiB

using Jypeli;
/// @author Vesa Lappalainen
/// @version 09.10.2011
///
/// <summary>
/// Kaksi lumiukkoa aliohjelman avulla
/// </summary>
public class LumiukkoAli : PhysicsGame
{
/// <summary>
/// Aliohjelmassa piirretään ja zoomataan kamera siten,
/// että kenttä näkyy hyvin ruudulla.
/// </summary>
public override void Begin()
{
Level.Size = Screen.Size;
Level.Background.Color = Color.Black;
PiirraLumiukko(this, 0, Level.Bottom + 200.0);
PiirraLumiukko(this, 200.0, Level.Bottom + 300.0);
Level.CreateBorders();
Gravity = new Vector(10, -200);
PhoneBackButton.Listen(ConfirmExit, "Lopeta peli");
Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
}
/// <summary>
/// Aliohjelma piirtää lumiukon
/// annettuun paikkaan.
/// </summary>
/// <param name="peli">Peli, johon lumiukko tehdään.</param>
/// <param name="x">Lumiukon alimman pallon x-koordinaatti.</param>
/// <param name="y">Lumiukon alimman pallon y-koordinaatti.</param>
public static void PiirraLumiukko(PhysicsGame peli, double x, double y)
{
PhysicsObject p1, p2, p3;
double r1 = 100;
double r2 = r1 * 0.50;
double r3 = r1 * 0.30;
p1 = PiirraPallo(peli, x, y, r1);
p2 = PiirraPallo(peli, x, p1.Y + r1 + r2, r2);
p3 = PiirraPallo(peli, x, p2.Y + r2 + r3, r3);
}
/// <summary>
/// Piirretään yksi pallo, jolle annetaan keskipiste ja säde
/// </summary>
/// <param name="peli">Peli, johon pallo piirretään</param>
/// <param name="x">pallon keksipisteen x</param>
/// <param name="y">pallon keskipisteen y</param>
/// <param name="r">pallon säde</param>
/// <returns>lisätty pallo</returns>
public static PhysicsObject PiirraPallo(PhysicsGame peli, double x, double y, double r)
{
PhysicsObject p = new PhysicsObject(2 * r, 2 * r, Shape.Circle);
p.X = x;
p.Y = y;
peli.Add(p);
return p;
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{D6F25CD6-F79E-406E-BE8B-E78B13FB3E3E}</ProjectGuid>
<ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LumiukkoAli</RootNamespace>
<AssemblyName>LumiukkoAli</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
<XnaPlatform>Windows</XnaPlatform>
<XnaProfile>Reach</XnaProfile>
<XnaCrossPlatformGroupID>fb083d1f-1216-4f14-8451-7875ae3f993e</XnaCrossPlatformGroupID>
<XnaOutputType>Game</XnaOutputType>
<ApplicationIcon>Game.ico</ApplicationIcon>
<Thumbnail>GameThumbnail.png</Thumbnail>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<ReferencePath>$(registry:HKEY_LOCAL_MACHINE\Software\Jypeli@Install_Dir)\lib\x86</ReferencePath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\x86\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
<UseVSHostingProcess>false</UseVSHostingProcess>
<PlatformTarget>x86</PlatformTarget>
<XnaCompressContent>false</XnaCompressContent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\x86\Release</OutputPath>
<DefineConstants>TRACE;WINDOWS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
<UseVSHostingProcess>false</UseVSHostingProcess>
<PlatformTarget>x86</PlatformTarget>
<XnaCompressContent>true</XnaCompressContent>
</PropertyGroup>
<ItemGroup>
<Reference Include="Jypeli">
</Reference>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Video, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Avatar, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="mscorlib">
<Private>False</Private>
</Reference>
<Reference Include="System">
<Private>False</Private>
</Reference>
<Reference Include="System.Xml">
<Private>False</Private>
</Reference>
<Reference Include="System.Core">
<Private>False</Private>
</Reference>
<Reference Include="System.Xml.Linq">
<Private>False</Private>
</Reference>
<Reference Include="System.Net">
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Ohjelma.cs" />
<Compile Include="LumiukkoAli.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Game.ico" />
<Content Include="GameThumbnail.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LumiukkoAliContent\LumiukkoAliContent.contentproj">
<Name>LumiukkoAliContent</Name>
<XnaReferenceType>Content</XnaReferenceType>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Xna.Framework.4.0">
<Visible>False</Visible>
<ProductName>Microsoft XNA Framework Redistributable 4.0</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
using System;
static class Ohjelma
{
#if WINDOWS || XBOX
static void Main(string[] args)
{
using (LumiukkoAli game = new LumiukkoAli())
{
#if !DEBUG
game.IsFullScreen = true;
#endif
game.Run();
}
}
#endif
}
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{BCE71CE3-DF66-4754-B1FB-3C59C706DD9C}</ProjectGuid>
<ProjectTypeGuids>{96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
<OutputPath>bin\$(Platform)\$(Configuration)</OutputPath>
<ContentRootDirectory>Content</ContentRootDirectory>
<ReferencePath>$(registry:HKEY_LOCAL_MACHINE\Software\Jypeli@Install_Dir)\lib\ContentExtensions</ReferencePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<RootNamespace>FysiikkaPeliContent</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.EffectImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.FBXImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.TextureImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.AudioImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.VideoImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="TextFileContentExtension" />
<Reference Include="AnimationExtension" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LumiukkoAli", "LumiukkoAli\LumiukkoAli\LumiukkoAli.csproj", "{D6F25CD6-F79E-406E-BE8B-E78B13FB3E3E}"
EndProject
Project("{96E2B04D-8817-42C6-938A-82C39BA4D311}") = "LumiukkoAliContent", "LumiukkoAli\LumiukkoAliContent\LumiukkoAliContent.contentproj", "{BCE71CE3-DF66-4754-B1FB-3C59C706DD9C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D6F25CD6-F79E-406E-BE8B-E78B13FB3E3E}.Debug|x86.ActiveCfg = Debug|x86
{D6F25CD6-F79E-406E-BE8B-E78B13FB3E3E}.Debug|x86.Build.0 = Debug|x86
{D6F25CD6-F79E-406E-BE8B-E78B13FB3E3E}.Release|x86.ActiveCfg = Release|x86
{D6F25CD6-F79E-406E-BE8B-E78B13FB3E3E}.Release|x86.Build.0 = Release|x86
{BCE71CE3-DF66-4754-B1FB-3C59C706DD9C}.Debug|x86.ActiveCfg = Debug|x86
{BCE71CE3-DF66-4754-B1FB-3C59C706DD9C}.Release|x86.ActiveCfg = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoGeneratedRunConfigurationManager">
<projectFile>Laskuja/Laskuja.csproj</projectFile>
</component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="fc85cdb2-6a04-4042-bd67-bd7da4e7a5a1" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/../luento04/.idea/.idea.luento04/.idea/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../luento04/.idea/.idea.luento04/.idea/indexLayout.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../luento04/.idea/.idea.luento04/.idea/vcs.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../luento04/LumiukkoAli/LumiukkoAli/Game.ico" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../luento04/LumiukkoAli/LumiukkoAli/GameThumbnail.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../luento04/LumiukkoAli/LumiukkoAli/LumiukkoAli.cs" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../luento04/LumiukkoAli/LumiukkoAli/LumiukkoAli.csproj" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../luento04/LumiukkoAli/LumiukkoAli/Ohjelma.cs" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../luento04/LumiukkoAli/LumiukkoAliContent/LumiukkoAliContent.contentproj" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../luento04/luento04.sln" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Laskuja/Laskuja.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Laskuja/Laskuja.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Laskuja/Laskuja.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/Laskuja/Laskuja.csproj" afterDir="false" />
<change beforePath="$PROJECT_DIR$/luento05.sln" beforeDir="false" afterPath="$PROJECT_DIR$/luento05.sln" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../.." />
</component>
<component name="ProjectColorInfo"><![CDATA[{
"associatedIndex": 1
}]]></component>
<component name="ProjectId" id="2VRuBU2j638zNIzGhr3wgs15sG1" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"WebServerToolWindowFactoryState": "false",
"git-widget-placeholder": "main",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"vue.rearranger.settings.migration": "true"
},
"keyToStringList": {
"rider.external.source.directories": [
"C:\\Users\\vesal\\AppData\\Roaming\\JetBrains\\Rider2023.2\\resharper-host\\DecompilerCache",
"C:\\Users\\vesal\\AppData\\Roaming\\JetBrains\\Rider2023.2\\resharper-host\\SourcesCache",
"C:\\Users\\vesal\\AppData\\Local\\Symbols\\src"
]
}
}]]></component>
<component name="RunManager" selected=".NET Project.Laskuja">
<configuration name="Laskuja" type="DotNetProject" factoryName=".NET Project">
<option name="EXE_PATH" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="PROJECT_PATH" value="$PROJECT_DIR$/Laskuja/Laskuja.csproj" />
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
<option name="PROJECT_KIND" value="Console" />
<option name="PROJECT_TFM" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="fc85cdb2-6a04-4042-bd67-bd7da4e7a5a1" name="Changes" comment="" />
<created>1694811079122</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1694811079122</updated>
<workItem from="1694811080272" duration="710000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="VcsManagerConfiguration">
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
</component>
</project>
\ No newline at end of file
using System; using System;
/// @author vesal /// @author vesal
/// @version 18.9.2017 /// @version 18.9.2017
......
<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk">
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <OutputType>Exe</OutputType>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> <TargetFramework>net7.0</TargetFramework>
<ProductVersion>8.0.30703</ProductVersion> <ExternalConsole>true</ExternalConsole>
<SchemaVersion>2.0</SchemaVersion> </PropertyGroup>
<ProjectGuid>{7D748B4E-8542-48A8-A7EF-9E359590CBCF}</ProjectGuid>
<OutputType>Exe</OutputType> </Project>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Laskuja</RootNamespace>
<AssemblyName>Laskuja</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Laskuja.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
using System;
using NUnit.Framework;
using static Laskuja;
[TestFixture]
[DefaultFloatingPointTolerance(0.000001)]
public class TestLaskuja
{
[Test]
public void TestKeskiarvo38()
{
Assert.AreEqual( 0, Keskiarvo(0, 0) , 0.000001, "in method Keskiarvo, line 39");
Assert.AreEqual( 8, Keskiarvo(6, 10) , 0.000001, "in method Keskiarvo, line 40");
Assert.AreEqual( 2.5, Keskiarvo(2, 3) , 0.000001, "in method Keskiarvo, line 41");
}
[Test]
public void TestNelionAla57()
{
Assert.AreEqual( 0, NelionAla(0) , 0.000001, "in method NelionAla, line 58");
Assert.AreEqual( 4, NelionAla(2) , 0.000001, "in method NelionAla, line 59");
Assert.AreEqual( 2.25, NelionAla(1.5) , 0.000001, "in method NelionAla, line 60");
}
}
<?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="..\Laskuja\Laskuja.csproj"/>
</ItemGroup>
</Project>

Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29306.81 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Laskuja", "Laskuja\Laskuja.csproj", "{8795F3DE-3634-4EAC-ADA8-C3711D85DE5E}"
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Laskuja", "Laskuja\Laskuja.csproj", "{7D748B4E-8542-48A8-A7EF-9E359590CBCF}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaskujaTest", "luento05Test\LaskujaTest.csproj", "{A9FEA3FD-4E09-4C6F-BAB0-EB990D4BA437}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LaskujaTest", "LaskujaTest\LaskujaTest.csproj", "{1FF97298-9EFD-4C3A-A236-D81632A55E31}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86 Debug|Any CPU = Debug|Any CPU
Release|x86 = Release|x86 Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7D748B4E-8542-48A8-A7EF-9E359590CBCF}.Debug|x86.ActiveCfg = Debug|x86 {8795F3DE-3634-4EAC-ADA8-C3711D85DE5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D748B4E-8542-48A8-A7EF-9E359590CBCF}.Debug|x86.Build.0 = Debug|x86 {8795F3DE-3634-4EAC-ADA8-C3711D85DE5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D748B4E-8542-48A8-A7EF-9E359590CBCF}.Release|x86.ActiveCfg = Release|x86 {8795F3DE-3634-4EAC-ADA8-C3711D85DE5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D748B4E-8542-48A8-A7EF-9E359590CBCF}.Release|x86.Build.0 = Release|x86 {8795F3DE-3634-4EAC-ADA8-C3711D85DE5E}.Release|Any CPU.Build.0 = Release|Any CPU
{A9FEA3FD-4E09-4C6F-BAB0-EB990D4BA437}.Debug|x86.ActiveCfg = Debug|x86 {1FF97298-9EFD-4C3A-A236-D81632A55E31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9FEA3FD-4E09-4C6F-BAB0-EB990D4BA437}.Debug|x86.Build.0 = Debug|x86 {1FF97298-9EFD-4C3A-A236-D81632A55E31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9FEA3FD-4E09-4C6F-BAB0-EB990D4BA437}.Release|x86.ActiveCfg = Release|x86 {1FF97298-9EFD-4C3A-A236-D81632A55E31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9FEA3FD-4E09-4C6F-BAB0-EB990D4BA437}.Release|x86.Build.0 = Release|x86 {1FF97298-9EFD-4C3A-A236-D81632A55E31}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {62BB75B8-EE36-452F-919D-A8F9FF50851B}
EndGlobalSection
EndGlobal EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Laskuja", "Laskuja\Laskuja.csproj", "{8795F3DE-3634-4EAC-ADA8-C3711D85DE5E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8795F3DE-3634-4EAC-ADA8-C3711D85DE5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8795F3DE-3634-4EAC-ADA8-C3711D85DE5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8795F3DE-3634-4EAC-ADA8-C3711D85DE5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8795F3DE-3634-4EAC-ADA8-C3711D85DE5E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
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