Lister er fucked

This commit is contained in:
Geir Okkenhaug Jerstad 2024-11-25 13:34:54 +01:00
parent 03716695f9
commit 12c164c6b3
13 changed files with 157 additions and 26 deletions

View file

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Pokemon</RootNamespace>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pokemon", "Pokemon.csproj", "{B5E5E3C3-6454-46D3-848D-7DE15A01B6A2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B5E5E3C3-6454-46D3-848D-7DE15A01B6A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5E5E3C3-6454-46D3-848D-7DE15A01B6A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B5E5E3C3-6454-46D3-848D-7DE15A01B6A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B5E5E3C3-6454-46D3-848D-7DE15A01B6A2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

22
Emne 3/Pokedex/Program.cs Normal file
View file

@ -0,0 +1,22 @@
using System;
namespace Pokedex
{
// 1/3 Planning
// 1/6 Coding
// 1/4 component test and early system test
// 1/4 system test, all components in hand
// - "The Mythical Man Month" by Frederick P. Brooks
class Program
{
static void Main(string[] args)
{
var pikachu = new Pokemon("Pikachu", 10, 30);
Console.WriteLine($"{pikachu.Name} har {pikachu.Health} hp og er level {pikachu.Level}");
var bulbasaur = new Pokemon("Bulbasaur",20, 90);
Console.WriteLine($"{bulbasaur.Name} har {bulbasaur.Health} hp og er level {bulbasaur.Level}");
}
}
}

15
Emne 3/Pokedex/pokedex.cs Normal file
View file

@ -0,0 +1,15 @@
namespace Pokedex;
public class Pokemon
{
internal int Health;
internal int Level;
internal string Name;
public Pokemon(string name, int level, int health)
{
Name = name;
Level = level;
Health = health;
}
}