1
0

feat: add commets and annotations for L4.LD_24

This commit is contained in:
Rokas Puzonas 2022-05-08 12:31:34 +03:00
parent 473552e643
commit 8dd076347d
32 changed files with 342 additions and 65 deletions

View File

@ -16,6 +16,8 @@ on:
- 'L2/LD_24/**'
- 'L3/LD_24/**'
- 'L3/LD_24Tests/**'
- 'L4/LD_24/**'
- 'L4/LD_24Tests/**'
jobs:
generate-and-upload:
@ -24,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Generate report
uses: RokasPuzonas/ktu-oop-report-generator@v2.0.8
uses: RokasPuzonas/ktu-oop-report-generator@v2.0.9
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
config-filename: ${{ env.CONFIG_FILENAME }}

View File

@ -1,5 +1,7 @@
Orc
Amandatown
Mercedes;Warrior;24;18;13;17;Cummings, Lehner and Wilkinson
Kelvin;Warrior;5;4;17;11;Waelchi, Kulas and Bruen
Domenico;Archer;24;10;3;25;Jacobi Group
Elf
Konopelskitown
Gail;Mage;6;23;24;17;Hand, Cummerata and Wolff
Garret;Mage;5;11;1;10;13;22;14;4
Maybelle;Hunter;21;11;25;17;24;25;5;5
Amy;Warrior;11;5;13;15;12;4;3;23
Natalie;Warrior;18;23;25;14;West Inc

View File

@ -1,12 +1,5 @@
Halfling
Leifberg
Clare;Warrior;17;2;7;23;14;23;19;6
Drake;Hunter;10;15;18;3;Will - Yost
Mike;Necromancer;18;24;3;11;23;11;22;9
Cathryn;Warrior;20;1;14;9;2;22;6;18
Tobin;Necromancer;12;14;21;18;Hermann, Cole and Gislason
Yasmine;Archer;6;24;3;4;O'Keefe and Sons
Shanna;Necromancer;3;5;15;14;Mraz, Jenkins and Bosco
Otha;Warrior;24;22;13;15;2;13;17;13
Cletus;Necromancer;4;8;20;16;Moen - Roberts
Katelynn;Hunter;2;24;9;9;Feil Inc
Elf
Port Sierraton
Lyla;Archer;5;10;5;21;Crona - Abshire
Ruthe;Necromancer;7;21;11;10;McDermott, Satterfield and Reichel
Berneice;Mage;6;23;23;6;Sawayn - Kovacek

View File

@ -1,6 +1,7 @@
Fairy
Celestineville
Alec;Hunter;20;14;13;4;9;6;21;23
Summer;Warrior;6;11;23;7;19;12;19;24
Rylan;Archer;13;17;23;20;10;10;17;7
Gisselle;Warrior;11;10;11;5;6;16;6;12
Orc
North Anastacio
Will;Mage;18;24;21;3;25;17;4;21
Brennan;Mage;2;5;4;8;Lindgren, Spinka and Walsh
Jannie;Hunter;15;5;25;10;Kub - Flatley
Nicolette;Archer;11;9;3;17;16;10;18;15
Noe;Warrior;3;7;14;16;Bradtke, Deckow and Larson

View File

@ -1,4 +1,5 @@
Warrior
Archer
Mage
Hunter
Warrior
Archer
Necromancer

1 Warrior Mage
Archer
2 Hunter Hunter
3 Warrior
4 Archer
5 Necromancer Necromancer

View File

@ -1,8 +1,2 @@
Halfling;Leifberg;Clare;Warrior;17;2;7;23;14;23;19;6
Fairy;Celestineville;Summer;Warrior;6;11;23;7;19;12;19;24
Fairy;Celestineville;Alec;Hunter;20;14;13;4;9;6;21;23
Halfling;Leifberg;Mike;Necromancer;18;24;3;11;23;11;22;9
Orc;Amandatown;Domenico;Archer;24;10;3;25;Jacobi Group
Halfling;Leifberg;Yasmine;Archer;6;24;3;4;O'Keefe and Sons
Halfling;Leifberg;Katelynn;Hunter;2;24;9;9;Feil Inc
Orc;Amandatown;Mercedes;Warrior;24;18;13;17;Cummings, Lehner and Wilkinson
Orc;North Anastacio;Brennan;Mage;2;5;4;8;Lindgren, Spinka and Walsh
Elf;Port Sierraton;Lyla;Archer;5;10;5;21;Crona - Abshire

1 Halfling;Leifberg;Clare;Warrior;17;2;7;23;14;23;19;6 Orc North Anastacio Brennan Mage 2 5 4 8 Lindgren, Spinka and Walsh
2 Fairy;Celestineville;Summer;Warrior;6;11;23;7;19;12;19;24 Elf Port Sierraton Lyla Archer 5 10 5 21 Crona - Abshire
Fairy;Celestineville;Alec;Hunter;20;14;13;4;9;6;21;23
Halfling;Leifberg;Mike;Necromancer;18;24;3;11;23;11;22;9
Orc;Amandatown;Domenico;Archer;24;10;3;25;Jacobi Group
Halfling;Leifberg;Yasmine;Archer;6;24;3;4;O'Keefe and Sons
Halfling;Leifberg;Katelynn;Hunter;2;24;9;9;Feil Inc
Orc;Amandatown;Mercedes;Warrior;24;18;13;17;Cummings, Lehner and Wilkinson

View File

@ -1,2 +1,2 @@
Orc
Fairy


1 Orc
2 Fairy

View File

@ -5,15 +5,42 @@ using System.Web;
namespace LD_24.Code
{
/// <summary>
/// Abstract actor class
/// </summary>
public abstract class Actor
{
/// <summary>
/// Race of actor
/// </summary>
public string Race { get; set; }
/// <summary>
/// Starting town of actor
/// </summary>
public string StartingTown { get; set; }
/// <summary>
/// Name of actor
/// </summary>
public string Name { get; set; }
/// <summary>
/// Class of actor
/// </summary>
public string Class { get; set; }
/// <summary>
/// Health points of actor
/// </summary>
public int Health { get; set; }
/// <summary>
/// Mana points of actor
/// </summary>
public int Mana { get; set; }
/// <summary>
/// Attack points of actor
/// </summary>
public int Attack { get; set; }
/// <summary>
/// Defense points of actor
/// </summary>
public int Defense { get; set; }
public Actor(string race, string startingTown, string name, string @class, int health, int mana, int attack, int defense)
@ -28,6 +55,10 @@ namespace LD_24.Code
Defense = defense;
}
/// <summary>
/// Serialize an actor into a valid CSV line
/// </summary>
/// <returns>A string representing the whole actor</returns>
public abstract string ToCSVLine();
}
}

View File

@ -5,11 +5,26 @@ using System.Web;
namespace LD_24.Code
{
/// <summary>
/// Class for a single hero
/// </summary>
public class Hero : Actor, IComparable<Hero>, IEquatable<Hero>
{
/// <summary>
/// Power points of hero
/// </summary>
public int Power { get; set; }
/// <summary>
/// Agility points of hero
/// </summary>
public int Agility { get; set; }
/// <summary>
/// Intellect points of hero
/// </summary>
public int Intellect { get; set; }
/// <summary>
/// Special points of hero
/// </summary>
public int Special { get; set; }
public Hero(string race, string startingTown, string name, string @class, int health, int mana, int attack, int defense, int power, int agility, int intellect, int special) : base(race, startingTown, name, @class, health, mana, attack, defense)
@ -20,16 +35,30 @@ namespace LD_24.Code
Special = special;
}
/// <summary>
/// Compare hero to hero by intellect
/// </summary>
/// <param name="other"></param>
/// <returns></returns>
public int CompareTo(Hero other)
{
return Intellect.CompareTo(other.Intellect);
}
/// <summary>
/// Check if 2 heros have the same intellect
/// </summary>
/// <param name="other"></param>
/// <returns></returns>
public bool Equals(Hero other)
{
return Intellect.Equals(other.Intellect);
}
/// <summary>
/// Serialize a hero to a CSV line
/// </summary>
/// <returns></returns>
public override string ToCSVLine()
{
return string.Join(";", Race, StartingTown, Name, Class, Health, Mana, Attack, Defense, Power, Agility, Intellect, Special);

View File

@ -9,12 +9,20 @@ using System.Text;
namespace LD_24.Code
{
/// <summary>
/// Utility class for reading/writing to files
/// </summary>
public static class InOutUtils
{
private static readonly List<string> Races = new List<string> { "Human", "Orc", "Elf", "Dwarf", "Fairy", "Halfling" };
private static readonly List<string> Classess = new List<string> { "Warrior", "Hunter", "Archer", "Mage", "Necromancer" };
private static readonly Faker faker = new Faker();
/// <summary>
/// Read line by lines from a file
/// </summary>
/// <param name="filename">Target file</param>
/// <returns>Lines</returns>
public static IEnumerable<string> ReadLines(string filename)
{
using (var reader = new StreamReader(filename))
@ -31,6 +39,12 @@ namespace LD_24.Code
}
}
/// <summary>
/// Read actors from a file
/// </summary>
/// <param name="filename">Target file</param>
/// <returns>A list of actors</returns>
/// <exception cref="Exception">Throws if a given line in a file is incorrect</exception>
public static List<Actor> ReadActors(string filename)
{
var actors = new List<Actor>();
@ -68,13 +82,17 @@ namespace LD_24.Code
return actors;
}
/// <summary>
/// Generate file with actors
/// </summary>
/// <param name="filename">Target file</param>
public static void GenerateFakeActors(string filename)
{
using (var writer = new StreamWriter(filename))
{
writer.WriteLine(faker.PickRandom(Races));
writer.WriteLine(faker.Address.City());
int count = faker.Random.Number(2, 10);
int count = faker.Random.Number(1, 5);
for (int i = 0; i < count; i++)
{
string name = faker.Name.FirstName();
@ -100,6 +118,13 @@ namespace LD_24.Code
}
}
/// <summary>
/// Read all files from a directory that have actors
/// </summary>
/// <param name="directory"></param>
/// <param name="pattern"></param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public static List<Actor> ReadActorsDir(string directory, string pattern = "*.txt")
{
if (!Directory.Exists(directory))
@ -114,6 +139,11 @@ namespace LD_24.Code
return merged;
}
/// <summary>
/// Writes a list of classes to a file
/// </summary>
/// <param name="filename">Target file</param>
/// <param name="classes">Target classes</param>
public static void PrintClassesCSV(string filename, List<string> classes)
{
using (var writer = new StreamWriter(filename, false, Encoding.UTF8))
@ -125,6 +155,11 @@ namespace LD_24.Code
}
}
/// <summary>
/// Prints missing actors to a file
/// </summary>
/// <param name="filename">Target file</param>
/// <param name="missingActors">Missing actor race names</param>
public static void PrintMissingActors(string filename, Tuple<List<string>, List<string>> missingActors)
{
using (var writer = new StreamWriter(filename, false, Encoding.UTF8))
@ -134,6 +169,11 @@ namespace LD_24.Code
}
}
/// <summary>
/// Prints a team of actors to a file
/// </summary>
/// <param name="filename">Target file</param>
/// <param name="team">Target actors</param>
public static void PrintTeam(string filename, List<Actor> team)
{
using (var writer = new StreamWriter(filename, false, Encoding.UTF8))

View File

@ -5,8 +5,14 @@ using System.Web;
namespace LD_24.Code
{
/// <summary>
/// Class for storing a single NPC
/// </summary>
public class NPC : Actor, IComparable<NPC>, IEquatable<NPC>
{
/// <summary>
/// blah blah blah blah
/// </summary>
public string Guild { get; set; }
public NPC(string race, string startingTown, string name, string @class, int health, int mana, int attack, int defense, string guild) : base(race, startingTown, name, @class, health, mana, attack, defense)
@ -14,16 +20,30 @@ namespace LD_24.Code
Guild = guild;
}
/// <summary>
/// blah blah
/// </summary>
/// <param name="other"></param>
/// <returns></returns>
public int CompareTo(NPC other)
{
return Attack.CompareTo(other.Attack);
}
/// <summary>
/// blah blah blah
/// </summary>
/// <param name="other"></param>
/// <returns></returns>
public bool Equals(NPC other)
{
return Attack.Equals(other.Attack);
}
/// <summary>
/// blah blah?
/// </summary>
/// <returns></returns>
public override string ToCSVLine()
{
return string.Join(";", Race, StartingTown, Name, Class, Health, Mana, Attack, Defense, Guild);

View File

@ -5,8 +5,16 @@ using System.Web;
namespace LD_24.Code
{
/// <summary>
/// Utility class for storing unrelated methods
/// </summary>
public static class TaskUtils
{
/// <summary>
/// Find the actors which have the most health by class
/// </summary>
/// <param name="actors"></param>
/// <returns></returns>
public static Dictionary<string, int> FindMostHealthByClass(List<Actor> actors)
{
Dictionary<string, int> mostHealth = new Dictionary<string, int>();
@ -23,6 +31,11 @@ namespace LD_24.Code
return mostHealth;
}
/// <summary>
/// Find all unique classes from a list of actors
/// </summary>
/// <param name="actors"></param>
/// <returns></returns>
public static List<string> FindAllClasses(List<Actor> actors)
{
List<string> result = new List<string>();
@ -36,6 +49,11 @@ namespace LD_24.Code
return result;
}
/// <summary>
/// Find all unique races from a list of actors
/// </summary>
/// <param name="actors"></param>
/// <returns></returns>
public static List<string> FindAllRaces(List<Actor> actors)
{
List<string> races = new List<string>();
@ -49,6 +67,11 @@ namespace LD_24.Code
return races;
}
/// <summary>
/// Finds which races are missing an NPC or Hero
/// </summary>
/// <param name="actors"></param>
/// <returns>A tuple where Item1 is missing Heros, and Item2 is missing NPCs</returns>
public static Tuple<List<string>, List<string>> FindMissingActors(List<Actor> actors)
{
var races = FindAllRaces(actors);
@ -68,6 +91,11 @@ namespace LD_24.Code
return Tuple.Create(missingHeroes, missingNPCs);
}
/// <summary>
/// Find the actors which have the most health in their respective classes
/// </summary>
/// <param name="actors"></param>
/// <returns></returns>
public static List<Actor> FilterMostHealthByClass(List<Actor> actors)
{
List<Actor> filtered = new List<Actor>();
@ -82,6 +110,12 @@ namespace LD_24.Code
return filtered;
}
/// <summary>
/// Filter out heros which, don't meet the min intellect (exclusively)
/// </summary>
/// <param name="actors"></param>
/// <param name="minIntellect"></param>
/// <returns></returns>
public static List<Hero> FilterHeroesByIntellect(List<Actor> actors, int minIntellect)
{
List<Hero> filtered = new List<Hero>();
@ -95,6 +129,12 @@ namespace LD_24.Code
return filtered;
}
/// <summary>
/// Filter out NPC which, don't meet the max attack (exclusively)
/// </summary>
/// <param name="actors"></param>
/// <param name="maxAttack"></param>
/// <returns></returns>
public static List<NPC> FilterNPCsByAttack(List<Actor> actors, int maxAttack)
{
List<NPC> filtered = new List<NPC>();

View File

@ -10,6 +10,9 @@ using System.Diagnostics;
namespace LD_24
{
/// <summary>
/// Main Form
/// </summary>
public partial class Forma1 : System.Web.UI.Page
{
private List<Actor> actors = null;

View File

@ -9,7 +9,15 @@ namespace LD_24
{
public partial class Forma1 : System.Web.UI.Page
{
public static IEnumerable<Tuple<T, TableRow>> ShowTable<T>(Table table, IEnumerable<T> list, params string[] columns)
/// <summary>
/// Show a table to the Web UI
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="table"></param>
/// <param name="list"></param>
/// <param name="columns"></param>
/// <returns></returns>
public static IEnumerable<Tuple<T, TableCellCollection>> ShowTable<T>(Table table, IEnumerable<T> list, params string[] columns)
{
TableHeaderRow header = new TableHeaderRow();
foreach (string column in columns)
@ -22,7 +30,7 @@ namespace LD_24
foreach (T item in list)
{
TableRow row = new TableRow();
yield return Tuple.Create(item, row);
yield return Tuple.Create(item, row.Cells);
table.Rows.Add(row);
noRows = false;
}
@ -35,33 +43,43 @@ namespace LD_24
}
}
/// <summary>
/// Show a list of actors in a table
/// </summary>
/// <param name="table"></param>
/// <param name="actors"></param>
public static void ShowActors(Table table, IEnumerable<Actor> actors)
{
foreach (var tuple in ShowTable(table, actors, "Rasė", "Miestas", "Vardas", "Klasė", "Gyvybė", "Mana", "Žala", "Šarvai"))
{
Actor actor = tuple.Item1;
TableRow row = tuple.Item2;
row.Cells.Add(new TableCell { Text = actor.Race });
row.Cells.Add(new TableCell { Text = actor.StartingTown });
row.Cells.Add(new TableCell { Text = actor.Name });
row.Cells.Add(new TableCell { Text = actor.Class });
row.Cells.Add(new TableCell { Text = actor.Health.ToString() });
row.Cells.Add(new TableCell { Text = actor.Mana.ToString() });
row.Cells.Add(new TableCell { Text = actor.Attack.ToString() });
row.Cells.Add(new TableCell { Text = actor.Defense.ToString() });
var actor = tuple.Item1;
var cells = tuple.Item2;
cells.Add(new TableCell { Text = actor.Race });
cells.Add(new TableCell { Text = actor.StartingTown });
cells.Add(new TableCell { Text = actor.Name });
cells.Add(new TableCell { Text = actor.Class });
cells.Add(new TableCell { Text = actor.Health.ToString() });
cells.Add(new TableCell { Text = actor.Mana.ToString() });
cells.Add(new TableCell { Text = actor.Attack.ToString() });
cells.Add(new TableCell { Text = actor.Defense.ToString() });
}
}
/// <summary>
/// Show a list of healthy actors to a table
/// </summary>
/// <param name="table"></param>
/// <param name="actors"></param>
public static void ShowHealthyActors(Table table, IEnumerable<Actor> actors)
{
foreach (var tuple in ShowTable(table, actors, "Vardas", "Rasė", "Klasė", "Gyvybė"))
{
Actor actor = tuple.Item1;
TableRow row = tuple.Item2;
row.Cells.Add(new TableCell { Text = actor.Name });
row.Cells.Add(new TableCell { Text = actor.Race });
row.Cells.Add(new TableCell { Text = actor.Class });
row.Cells.Add(new TableCell { Text = actor.Health.ToString() });
var actor = tuple.Item1;
var cells = tuple.Item2;
cells.Add(new TableCell { Text = actor.Name });
cells.Add(new TableCell { Text = actor.Race });
cells.Add(new TableCell { Text = actor.Class });
cells.Add(new TableCell { Text = actor.Health.ToString() });
}
}
}

View File

@ -71,9 +71,6 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="App_Data\Actors1.txt" />
<Content Include="App_Data\Actors2.txt" />
<Content Include="App_Data\Actors3.txt" />
<Content Include="Forma1.aspx" />
<Content Include="Styles\main.css" />
<Content Include="Web.config" />
@ -97,9 +94,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Data\Klasės.csv" />
<Content Include="App_Data\Trūkstami.csv" />
<Content Include="App_Data\Riktine.csv" />
<None Include="packages.config" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
@ -108,7 +102,13 @@
<DependentUpon>Web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="tests\1\inputs\" />
<Folder Include="tests\1\outputs\" />
<Folder Include="tests\2\inputs\" />
<Folder Include="tests\2\outputs\" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -0,0 +1,3 @@
Elf
Padbergborough
Verla;Warrior;16;23;16;23;21;12;2;10

View File

@ -0,0 +1,7 @@
Dwarf
Verdiebury
Toney;Hunter;20;2;9;11;13;6;17;16
Andreanne;Warrior;14;25;6;23;Rempel LLC
Octavia;Necromancer;16;20;13;14;Considine, Runte and Mosciski
Ocie;Warrior;14;16;22;7;14;3;3;18
Vicente;Hunter;16;20;24;3;Farrell, Watsica and O'Keefe

View File

@ -0,0 +1,7 @@
Orc
East Chelseyberg
Shaina;Archer;20;2;23;1;Wintheiser, Heidenreich and Hansen
Lucie;Archer;12;16;14;2;9;5;19;15
Doyle;Archer;12;14;18;3;10;10;18;1
Amir;Mage;15;9;16;2;Steuber Group
Muhammad;Necromancer;2;19;12;2;3;7;22;2

View File

@ -0,0 +1,5 @@
Warrior
Hunter
Necromancer
Archer
Mage
1 Warrior
2 Hunter
3 Necromancer
4 Archer
5 Mage

View File

@ -0,0 +1,7 @@
Elf;Padbergborough;Verla;Warrior;16;23;16;23;21;12;2;10
Dwarf;Verdiebury;Ocie;Warrior;14;16;22;7;14;3;3;18
Dwarf;Verdiebury;Toney;Hunter;20;2;9;11;13;6;17;16
Orc;East Chelseyberg;Doyle;Archer;12;14;18;3;10;10;18;1
Orc;East Chelseyberg;Lucie;Archer;12;16;14;2;9;5;19;15
Orc;East Chelseyberg;Muhammad;Necromancer;2;19;12;2;3;7;22;2
Dwarf;Verdiebury;Andreanne;Warrior;14;25;6;23;Rempel LLC
1 Elf;Padbergborough;Verla;Warrior;16;23;16;23;21;12;2;10
2 Dwarf;Verdiebury;Ocie;Warrior;14;16;22;7;14;3;3;18
3 Dwarf;Verdiebury;Toney;Hunter;20;2;9;11;13;6;17;16
4 Orc;East Chelseyberg;Doyle;Archer;12;14;18;3;10;10;18;1
5 Orc;East Chelseyberg;Lucie;Archer;12;16;14;2;9;5;19;15
6 Orc;East Chelseyberg;Muhammad;Necromancer;2;19;12;2;3;7;22;2
7 Dwarf;Verdiebury;Andreanne;Warrior;14;25;6;23;Rempel LLC

View File

@ -0,0 +1,2 @@

Elf
1 Elf

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -0,0 +1,7 @@
Elf
Konopelskitown
Gail;Mage;6;23;24;17;Hand, Cummerata and Wolff
Garret;Mage;5;11;1;10;13;22;14;4
Maybelle;Hunter;21;11;25;17;24;25;5;5
Amy;Warrior;11;5;13;15;12;4;3;23
Natalie;Warrior;18;23;25;14;West Inc

View File

@ -0,0 +1,5 @@
Elf
Port Sierraton
Lyla;Archer;5;10;5;21;Crona - Abshire
Ruthe;Necromancer;7;21;11;10;McDermott, Satterfield and Reichel
Berneice;Mage;6;23;23;6;Sawayn - Kovacek

View File

@ -0,0 +1,7 @@
Orc
North Anastacio
Will;Mage;18;24;21;3;25;17;4;21
Brennan;Mage;2;5;4;8;Lindgren, Spinka and Walsh
Jannie;Hunter;15;5;25;10;Kub - Flatley
Nicolette;Archer;11;9;3;17;16;10;18;15
Noe;Warrior;3;7;14;16;Bradtke, Deckow and Larson

View File

@ -0,0 +1,5 @@
Mage
Hunter
Warrior
Archer
Necromancer
1 Mage
2 Hunter
3 Warrior
4 Archer
5 Necromancer

View File

@ -0,0 +1,2 @@
Orc;North Anastacio;Brennan;Mage;2;5;4;8;Lindgren, Spinka and Walsh
Elf;Port Sierraton;Lyla;Archer;5;10;5;21;Crona - Abshire
1 Orc North Anastacio Brennan Mage 2 5 4 8 Lindgren, Spinka and Walsh
2 Elf Port Sierraton Lyla Archer 5 10 5 21 Crona - Abshire

View File

@ -0,0 +1,2 @@


Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -13,7 +13,7 @@ guide = """
kad neįmanoma susitiki.
"""
problem = """
LD_24. Susitikimas.
LD_24. **Susitikimas.**
Grupė draugų nusprendė susitikti mieste, o po to kartu eiti valgyti picos. Bet
tuomet jie susiginčijo, kur geriausia susitikti, ir kurioje picerijoje valgyti.
@ -58,7 +58,7 @@ guide = """
* Spausti "Atrinkti" mygtuką
"""
problem = """
LD_24. Detalės.
LD_24. **Detalės.**
Internetinėje parduotuvėje pirkėjai užsisakinėja robotų gamybai reikalingus
įtaisus. Suraskite populiariausią įtaisą, kiek tokių įtaisų parduota ir už
@ -99,7 +99,7 @@ tests_screenshots = [
"L3/LD_24Tests/screenshot3.PNG"
]
problem = """
LD_24. Detalės.
LD_24. **Detalės.**
Internetinėje parduotuvėje pirkėjai užsisakinėja robotų gamybai reikalingus
įtaisus. Suraskite populiariausią įtaisą, kiek tokių įtaisų parduota ir už
@ -121,6 +121,50 @@ didesnė kaip k eurų (n ir k įvedami klaviatūra).
[[sections]]
title = "Polimorfizmas ir išimčių valdymas (L4)"
project = "L4/LD_24"
tests_project = "L4/LD_24Tests"
interface_scheme = "L4/LD_24/interface-scheme.png"
guide = """
* Atsidaryti tinklalapį
* Įvesti minimalus herojaus intelekto kiekį
* Įvesti maksimalus NPC žalos kiekį
* Spausti "Vykdyti" mygtuką
"""
tests_screenshots = [
"L4/LD_24Tests/screenshot1.png"
]
problem = """
U4_24. **Kompiuterinis žaidimas.**
Žaidimo pasaulyje yra dviejų tipų veikėjai - žaidėjo valdomi herojai bei
kompiuterio valdomi NPC (non playable character). Sugrupavote žaidimo veikėjus pagal rases, ir surašėte
jų duomenis į skirtingus failus. Duomenų formatas toks: pirmoje eilutėje rasės pavadinimas. Antroje
pradinis miestas. Toliau informacija apie žaidimo veikėjus. Sukurkite abstrakčią klasę Actor (savybės -
vardas, klasė, gyvybės taškai, mana, žalos taškai, gynybos taškai), kurią paveldės klasės Hero (savybės
jėga, vikrumas, intelektas, ypatinga galia), NPC (savybė gildija).
* Raskite kiekvienos klasės daugiausiai gyvybės taškų turintį veikėją, ekrane atspausdinkite jo vardą,
rasę, klasę ir gyvybės taškų kiekį.
* Sudarykite visų veikėjų klasių sąrašą ir įrašykite į failą Klasės.csv .
* Norite, jog kiekviena rasė turėtų bent po vieną kiekvienos klasės herojų ir NPC. Raskite, kokių
klasių herojų ar NPC trūksta kiekvienai rasei. Į failą Trūkstami.csv įrašykite kiekvienos rasės
pavadinimą, trūkstamų herojų klasių sąrašą, trūkstamų NPC klasių sąrašą.
* Sudarykite ir surikiuokite bendrą veikėjų rinktinę. Į šią rinktinę patenka herojai, jei jų intelekto
reikšmė viršija nurodytą dydį. Į šią rinktinę patenka NPC, jei jų žalos taškai neviršija nurodyto
dydžio. Herojus rikiuokite pagal intelektą, o NPC pagal žalos taškus. Rezultatus įrašykite į failą
Rinktine.csv.
"""
[[sections]]
title = "Deklaratyvusis programavimas (L5)"
problem = """
LDD_24. **Leidėjai.**
Žmonės užsisako spaudą. Užsakymas vyksta metų ribose. Pirmoje failo eilutėje
nurodyta įvedimo data (failų daug), o tolesnėse eilutėse nurodyta prenumeratoriaus pavardė, adresas,
laikotarpio pradžia (nurodyta sveiku skaičiumi 1..12), laikotarpio ilgis, leidinio kodas, leidinių kiekis.
Atskirame faile duota tokia informacija apie leidinius: kodas, pavadinimas, leidėjo pavadinimas, vieno
mėnesio kaina. Suskaičiuoti kiekvienam leidėjui nurodyto mėnesio (įvedama klaviatūra) pajamas.
Atspausdinkite leidėjų pajamas, surikiuotas pagal dydį ir leidėjų pavadinimus, nurodant ir leidėjų
leidinius su jų atneštomis pajamomis. Leidėjų pavadinimai neturi kartotis.
"""