feat: complete Lab1
This commit is contained in:
parent
b1a0ac0cfb
commit
0c76bf44c3
12
Recursion/LD_24/App_Data/Rezultatai.txt
Normal file
12
Recursion/LD_24/App_Data/Rezultatai.txt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
D...P
|
||||||
|
XX...
|
||||||
|
D.S.P
|
||||||
|
XX...
|
||||||
|
D.S..
|
||||||
|
|
||||||
|
1 1
|
||||||
|
1 3
|
||||||
|
1 5
|
||||||
|
Susitikimo vieta 3 3
|
||||||
|
Picerija 5 3
|
||||||
|
Nueita 32
|
6
Recursion/LD_24/App_Data/U3.txt
Normal file
6
Recursion/LD_24/App_Data/U3.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
5 5
|
||||||
|
D...P
|
||||||
|
XX...
|
||||||
|
D.S.P
|
||||||
|
XX...
|
||||||
|
D.S..
|
21
Recursion/LD_24/Code/BestPizzeriaResult.cs
Normal file
21
Recursion/LD_24/Code/BestPizzeriaResult.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace LD_24.Code
|
||||||
|
{
|
||||||
|
public class BestPizzeriaResult
|
||||||
|
{
|
||||||
|
public Point Pizzeria { get; private set; }
|
||||||
|
public Point MeetingSpot { get; private set; }
|
||||||
|
public int Cost { get; private set; }
|
||||||
|
|
||||||
|
public BestPizzeriaResult(Point pizzeria, Point meetingSpot, int cost)
|
||||||
|
{
|
||||||
|
Pizzeria = pizzeria;
|
||||||
|
MeetingSpot = meetingSpot;
|
||||||
|
Cost = cost;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
99
Recursion/LD_24/Code/InOutUtils.cs
Normal file
99
Recursion/LD_24/Code/InOutUtils.cs
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace LD_24.Code
|
||||||
|
{
|
||||||
|
public class InOutUtils
|
||||||
|
{
|
||||||
|
public static Map ReadMap(string filename)
|
||||||
|
{
|
||||||
|
string[] lines = File.ReadAllLines(filename);
|
||||||
|
string[] height_width = lines[0].Split(' ');
|
||||||
|
int height = int.Parse(height_width[0]);
|
||||||
|
int width = int.Parse(height_width[1]);
|
||||||
|
|
||||||
|
Map map = new Map(width, height);
|
||||||
|
for (int i = 1; i < height+1; i++)
|
||||||
|
{
|
||||||
|
int x = 0;
|
||||||
|
foreach (char c in lines[i])
|
||||||
|
{
|
||||||
|
MapTile tile;
|
||||||
|
if (c == '.') {
|
||||||
|
tile = MapTile.Empty;
|
||||||
|
} else if (c == 'X') {
|
||||||
|
tile = MapTile.Wall;
|
||||||
|
} else if (c == 'P') {
|
||||||
|
tile = MapTile.Pizzeria;
|
||||||
|
} else if (c == 'D') {
|
||||||
|
tile = MapTile.Friend;
|
||||||
|
} else if (c == 'S') {
|
||||||
|
tile = MapTile.MeetingSpot;
|
||||||
|
} else {
|
||||||
|
throw new Exception($"Invalid tile '{c}'");
|
||||||
|
}
|
||||||
|
map.Set(x, i - 1, tile);
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void WriteMap(StreamWriter writer, Map map)
|
||||||
|
{
|
||||||
|
for (int y = 0; y < map.Height; y++)
|
||||||
|
{
|
||||||
|
for (int x = 0; x < map.Width; x++)
|
||||||
|
{
|
||||||
|
switch (map.Get(x, y))
|
||||||
|
{
|
||||||
|
case MapTile.Empty:
|
||||||
|
writer.Write('.');
|
||||||
|
break;
|
||||||
|
case MapTile.Pizzeria:
|
||||||
|
writer.Write('P');
|
||||||
|
break;
|
||||||
|
case MapTile.Friend:
|
||||||
|
writer.Write('D');
|
||||||
|
break;
|
||||||
|
case MapTile.MeetingSpot:
|
||||||
|
writer.Write('S');
|
||||||
|
break;
|
||||||
|
case MapTile.Wall:
|
||||||
|
writer.Write('X');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
writer.Write('?');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
writer.Write('\n');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void WriteBestPizzeriaResult(StreamWriter writer, BestPizzeriaResult result)
|
||||||
|
{
|
||||||
|
if (result == null)
|
||||||
|
{
|
||||||
|
writer.WriteLine("Neįmanoma");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
writer.WriteLine("Susitikimo vieta {0} {1}", result.MeetingSpot.X + 1, result.MeetingSpot.Y + 1);
|
||||||
|
writer.WriteLine("Picerija {0} {1}", result.Pizzeria.X + 1, result.Pizzeria.Y + 1);
|
||||||
|
writer.WriteLine("Nueita {0}", result.Cost);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void WriteFriendPositions(StreamWriter writer, List<Point> friends)
|
||||||
|
{
|
||||||
|
foreach (var friend in friends)
|
||||||
|
{
|
||||||
|
writer.WriteLine("{0} {1}", friend.X + 1, friend.Y + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
52
Recursion/LD_24/Code/Map.cs
Normal file
52
Recursion/LD_24/Code/Map.cs
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace LD_24.Code
|
||||||
|
{
|
||||||
|
public class Map
|
||||||
|
{
|
||||||
|
MapTile[,] data;
|
||||||
|
public int Width { get; set; }
|
||||||
|
public int Height { get; set; }
|
||||||
|
|
||||||
|
public Map(int width, int height)
|
||||||
|
{
|
||||||
|
data = new MapTile[width, height];
|
||||||
|
Width = width;
|
||||||
|
Height = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Set(int x, int y, MapTile tile)
|
||||||
|
{
|
||||||
|
data[x, y] = tile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MapTile Get(int x, int y)
|
||||||
|
{
|
||||||
|
return data[x, y];
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsInBounds(int x, int y)
|
||||||
|
{
|
||||||
|
return x >= 0 && x < Width && y >= 0 && y < Height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Point> FindAll(MapTile tile)
|
||||||
|
{
|
||||||
|
List<Point> points = new List<Point>();
|
||||||
|
for (int i = 0; i < Width; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < Height; j++)
|
||||||
|
{
|
||||||
|
if (data[i, j] == tile)
|
||||||
|
{
|
||||||
|
points.Add(new Point(i, j));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
16
Recursion/LD_24/Code/MapTile.cs
Normal file
16
Recursion/LD_24/Code/MapTile.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace LD_24.Code
|
||||||
|
{
|
||||||
|
public enum MapTile
|
||||||
|
{
|
||||||
|
Empty,
|
||||||
|
Wall,
|
||||||
|
Friend,
|
||||||
|
Pizzeria,
|
||||||
|
MeetingSpot
|
||||||
|
}
|
||||||
|
}
|
35
Recursion/LD_24/Code/Point.cs
Normal file
35
Recursion/LD_24/Code/Point.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace LD_24.Code
|
||||||
|
{
|
||||||
|
public class Point
|
||||||
|
{
|
||||||
|
public int X { get; set; }
|
||||||
|
public int Y { get; set; }
|
||||||
|
|
||||||
|
public Point(int x, int y)
|
||||||
|
{
|
||||||
|
X = x;
|
||||||
|
Y = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
return obj is Point point &&
|
||||||
|
X == point.X &&
|
||||||
|
Y == point.Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
int hashCode = 1861411795;
|
||||||
|
hashCode = hashCode * -1521134295 + X.GetHashCode();
|
||||||
|
hashCode = hashCode * -1521134295 + Y.GetHashCode();
|
||||||
|
return hashCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
115
Recursion/LD_24/Code/TaskUtils.cs
Normal file
115
Recursion/LD_24/Code/TaskUtils.cs
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace LD_24.Code
|
||||||
|
{
|
||||||
|
|
||||||
|
public class TaskUtils
|
||||||
|
{
|
||||||
|
public static BestPizzeriaResult FindBestPizzeria(Map map)
|
||||||
|
{
|
||||||
|
int lowestCost = int.MaxValue;
|
||||||
|
Point bestMeetingSpot = null;
|
||||||
|
Point bestPizzeria = null;
|
||||||
|
|
||||||
|
List<Point> friends = map.FindAll(MapTile.Friend);
|
||||||
|
List<Point> pizzerias = map.FindAll(MapTile.Pizzeria);
|
||||||
|
List<Point> meetingSpots = map.FindAll(MapTile.MeetingSpot);
|
||||||
|
|
||||||
|
foreach (var meetingSpot in meetingSpots)
|
||||||
|
{
|
||||||
|
foreach (var pizzeria in pizzerias)
|
||||||
|
{
|
||||||
|
int totalCost = 0;
|
||||||
|
|
||||||
|
int toPizzeriaCostPerFriend = FindBestPath(map, meetingSpot, pizzeria);
|
||||||
|
if (toPizzeriaCostPerFriend < 0) { break; }
|
||||||
|
totalCost += toPizzeriaCostPerFriend * friends.Count;
|
||||||
|
|
||||||
|
bool failed = false;
|
||||||
|
foreach (var friend in friends)
|
||||||
|
{
|
||||||
|
int toMeetingCost = FindBestPath(map, friend, meetingSpot);
|
||||||
|
if (toMeetingCost < 0) { failed = true; break; }
|
||||||
|
totalCost += toMeetingCost;
|
||||||
|
|
||||||
|
int toHomeCost = FindBestPath(map, pizzeria, friend);
|
||||||
|
if (toHomeCost < 0) { failed = true; break; }
|
||||||
|
totalCost += toHomeCost;
|
||||||
|
}
|
||||||
|
if (failed) { break; }
|
||||||
|
|
||||||
|
if (totalCost < lowestCost)
|
||||||
|
{
|
||||||
|
lowestCost = totalCost;
|
||||||
|
bestMeetingSpot = meetingSpot;
|
||||||
|
bestPizzeria = pizzeria;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bestMeetingSpot != null)
|
||||||
|
{
|
||||||
|
return new BestPizzeriaResult(bestPizzeria, bestMeetingSpot, lowestCost);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int FindBestPath(Map map, Point from, Point to)
|
||||||
|
{
|
||||||
|
return FindBestPath(map, from, to, new Stack<Point>());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int FindBestPath(Map map, Point from, Point to, Stack<Point> exploredPoints)
|
||||||
|
{
|
||||||
|
if (from.Equals(to)) { return 0; }
|
||||||
|
|
||||||
|
int minCost = -1;
|
||||||
|
exploredPoints.Push(from);
|
||||||
|
foreach (var neighbour in GetNeighbours(map, from.X, from.Y))
|
||||||
|
{
|
||||||
|
if (!exploredPoints.Contains(neighbour))
|
||||||
|
{
|
||||||
|
int cost = FindBestPath(map, neighbour, to, exploredPoints);
|
||||||
|
if (cost >= 0)
|
||||||
|
{
|
||||||
|
if (minCost < 0)
|
||||||
|
{
|
||||||
|
minCost = cost + 1;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
minCost = Math.Min(minCost, cost + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exploredPoints.Pop();
|
||||||
|
return minCost;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IEnumerable<Point> GetNeighbours(Map map, int x, int y)
|
||||||
|
{
|
||||||
|
if (map.IsInBounds(x + 1, y) && map.Get(x + 1, y) != MapTile.Wall)
|
||||||
|
{
|
||||||
|
yield return new Point(x + 1, y);
|
||||||
|
}
|
||||||
|
if (map.IsInBounds(x, y + 1) && map.Get(x, y + 1) != MapTile.Wall)
|
||||||
|
{
|
||||||
|
yield return new Point(x, y + 1);
|
||||||
|
}
|
||||||
|
if (map.IsInBounds(x - 1, y) && map.Get(x - 1, y) != MapTile.Wall)
|
||||||
|
{
|
||||||
|
yield return new Point(x - 1, y);
|
||||||
|
}
|
||||||
|
if (map.IsInBounds(x, y - 1) && map.Get(x, y - 1) != MapTile.Wall)
|
||||||
|
{
|
||||||
|
yield return new Point(x, y - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
26
Recursion/LD_24/Forma1.aspx
Normal file
26
Recursion/LD_24/Forma1.aspx
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Forma1.aspx.cs" Inherits="LD_24.Forma1" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<asp:Table ID="Table1" runat="server" BackColor="#FFFFCC" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" Font-Bold="True">
|
||||||
|
</asp:Table>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Skaičiuoti" />
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<asp:Label ID="Label1" runat="server" Text="Draugų koordinatės:" Visible="False"></asp:Label>
|
||||||
|
<asp:BulletedList ID="BulletedList1" runat="server" Visible="False">
|
||||||
|
</asp:BulletedList>
|
||||||
|
<asp:Label ID="Label2" runat="server" Text="Susitikimas:" Visible="False"></asp:Label>
|
||||||
|
<br />
|
||||||
|
<asp:Label ID="Label3" runat="server" Visible="False"></asp:Label>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
109
Recursion/LD_24/Forma1.aspx.cs
Normal file
109
Recursion/LD_24/Forma1.aspx.cs
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace LD_24
|
||||||
|
{
|
||||||
|
public partial class Forma1 : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
private string inputFilename;
|
||||||
|
private string outputFilename;
|
||||||
|
private Code.Map map;
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
inputFilename = Server.MapPath(@"App_Data/U3.txt");
|
||||||
|
outputFilename = Server.MapPath(@"App_Data/Rezultatai.txt");
|
||||||
|
|
||||||
|
map = Code.InOutUtils.ReadMap(inputFilename);
|
||||||
|
ShowMap(Table1, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void Button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
List<Code.Point> friends = map.FindAll(Code.MapTile.Friend);
|
||||||
|
Code.BestPizzeriaResult result = Code.TaskUtils.FindBestPizzeria(map);
|
||||||
|
|
||||||
|
Label1.Visible = true;
|
||||||
|
Label2.Visible = true;
|
||||||
|
Label3.Visible = true;
|
||||||
|
BulletedList1.Visible = true;
|
||||||
|
ShowFriends(BulletedList1, friends);
|
||||||
|
ShowBestPizzeriaResult(Label3, result);
|
||||||
|
|
||||||
|
using (StreamWriter writer = new StreamWriter(outputFilename))
|
||||||
|
{
|
||||||
|
Code.InOutUtils.WriteMap(writer, map);
|
||||||
|
writer.Write('\n');
|
||||||
|
Code.InOutUtils.WriteFriendPositions(writer, friends);
|
||||||
|
Code.InOutUtils.WriteBestPizzeriaResult(writer, result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowFriends(BulletedList list, List<Code.Point> friends)
|
||||||
|
{
|
||||||
|
list.Items.Clear();
|
||||||
|
foreach (var friend in friends)
|
||||||
|
{
|
||||||
|
list.Items.Add(String.Format("X = {0}, Y = {1}", friend.X + 1, friend.Y + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowBestPizzeriaResult(Label label, Code.BestPizzeriaResult result)
|
||||||
|
{
|
||||||
|
if (result == null)
|
||||||
|
{
|
||||||
|
label.Text = "Neįmanoma";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
label.Text = String.Format("Susitikimo vieta (X = {0}, Y = {1})", result.MeetingSpot.X + 1, result.MeetingSpot.Y + 1);
|
||||||
|
label.Text += "<br />";
|
||||||
|
label.Text += String.Format("Picerija (X = {0}, Y = {1})", result.Pizzeria.X + 1, result.Pizzeria.Y + 1);
|
||||||
|
label.Text += "<br />";
|
||||||
|
label.Text += String.Format("Nueita {0}", result.Cost);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowMap(Table table, Code.Map map)
|
||||||
|
{
|
||||||
|
table.Rows.Clear();
|
||||||
|
for (int y = 0; y < map.Height; y++)
|
||||||
|
{
|
||||||
|
TableRow row = new TableRow();
|
||||||
|
for (int x = 0; x < map.Width; x++)
|
||||||
|
{
|
||||||
|
TableCell cell = new TableCell();
|
||||||
|
cell.Width = 20;
|
||||||
|
cell.Height = 20;
|
||||||
|
switch (map.Get(x, y))
|
||||||
|
{
|
||||||
|
case Code.MapTile.Empty:
|
||||||
|
cell.Text = ".";
|
||||||
|
break;
|
||||||
|
case Code.MapTile.Pizzeria:
|
||||||
|
cell.Text = "P";
|
||||||
|
break;
|
||||||
|
case Code.MapTile.Friend:
|
||||||
|
cell.Text = "D";
|
||||||
|
break;
|
||||||
|
case Code.MapTile.MeetingSpot:
|
||||||
|
cell.Text = "S";
|
||||||
|
break;
|
||||||
|
case Code.MapTile.Wall:
|
||||||
|
cell.Text = "X";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
cell.Text = "?";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
row.Cells.Add(cell);
|
||||||
|
}
|
||||||
|
table.Rows.Add(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
80
Recursion/LD_24/Forma1.aspx.designer.cs
generated
Normal file
80
Recursion/LD_24/Forma1.aspx.designer.cs
generated
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace LD_24
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class Forma1
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Table1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Table Table1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Button1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Button Button1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Label1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label Label1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// BulletedList1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.BulletedList BulletedList1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Label2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label Label2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Label3 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label Label3;
|
||||||
|
}
|
||||||
|
}
|
140
Recursion/LD_24/LD_24.csproj
Normal file
140
Recursion/LD_24/LD_24.csproj
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProductVersion>
|
||||||
|
</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{6AAB1A29-81E1-4A08-A8C3-9C203C684B8F}</ProjectGuid>
|
||||||
|
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>LD_24</RootNamespace>
|
||||||
|
<AssemblyName>LD_24</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<UseIISExpress>true</UseIISExpress>
|
||||||
|
<Use64BitIISExpress />
|
||||||
|
<IISExpressSSLPort>
|
||||||
|
</IISExpressSSLPort>
|
||||||
|
<IISExpressAnonymousAuthentication />
|
||||||
|
<IISExpressWindowsAuthentication />
|
||||||
|
<IISExpressUseClassicPipelineMode />
|
||||||
|
<UseGlobalApplicationHostFile />
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Web.DynamicData" />
|
||||||
|
<Reference Include="System.Web.Entity" />
|
||||||
|
<Reference Include="System.Web.ApplicationServices" />
|
||||||
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="System.Web.Extensions" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Web" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="System.Configuration" />
|
||||||
|
<Reference Include="System.Web.Services" />
|
||||||
|
<Reference Include="System.EnterpriseServices" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
|
||||||
|
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="App_Data\Rezultatai.txt" />
|
||||||
|
<Content Include="App_Data\U3.txt" />
|
||||||
|
<Content Include="Forma1.aspx" />
|
||||||
|
<Content Include="Web.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Code\BestPizzeriaResult.cs" />
|
||||||
|
<Compile Include="Code\InOutUtils.cs" />
|
||||||
|
<Compile Include="Code\Map.cs" />
|
||||||
|
<Compile Include="Code\MapTile.cs" />
|
||||||
|
<Compile Include="Code\Point.cs" />
|
||||||
|
<Compile Include="Code\TaskUtils.cs" />
|
||||||
|
<Compile Include="Forma1.aspx.cs">
|
||||||
|
<DependentUpon>Forma1.aspx</DependentUpon>
|
||||||
|
<SubType>ASPXCodeBehind</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Forma1.aspx.designer.cs">
|
||||||
|
<DependentUpon>Forma1.aspx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="Web.Debug.config">
|
||||||
|
<DependentUpon>Web.config</DependentUpon>
|
||||||
|
</None>
|
||||||
|
<None Include="Web.Release.config">
|
||||||
|
<DependentUpon>Web.config</DependentUpon>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
|
<PropertyGroup>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
|
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||||
|
<ProjectExtensions>
|
||||||
|
<VisualStudio>
|
||||||
|
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||||
|
<WebProjectProperties>
|
||||||
|
<UseIIS>True</UseIIS>
|
||||||
|
<AutoAssignPort>True</AutoAssignPort>
|
||||||
|
<DevelopmentServerPort>57614</DevelopmentServerPort>
|
||||||
|
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||||
|
<IISUrl>http://localhost:44363/</IISUrl>
|
||||||
|
<NTLMAuthentication>False</NTLMAuthentication>
|
||||||
|
<UseCustomServer>False</UseCustomServer>
|
||||||
|
<CustomServerUrl>
|
||||||
|
</CustomServerUrl>
|
||||||
|
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||||
|
</WebProjectProperties>
|
||||||
|
</FlavorProperties>
|
||||||
|
</VisualStudio>
|
||||||
|
</ProjectExtensions>
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
|
||||||
|
</Target>
|
||||||
|
<!-- 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>
|
35
Recursion/LD_24/Properties/AssemblyInfo.cs
Normal file
35
Recursion/LD_24/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("LD_24")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("LD_24")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("6aab1a29-81e1-4a08-a8c3-9c203c684b8f")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
30
Recursion/LD_24/Web.Debug.config
Normal file
30
Recursion/LD_24/Web.Debug.config
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<!-- For more information on using web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||||
|
|
||||||
|
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||||
|
<!--
|
||||||
|
In the example below, the "SetAttributes" transform will change the value of
|
||||||
|
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||||
|
finds an attribute "name" that has a value of "MyDB".
|
||||||
|
|
||||||
|
<connectionStrings>
|
||||||
|
<add name="MyDB"
|
||||||
|
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||||
|
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||||
|
</connectionStrings>
|
||||||
|
-->
|
||||||
|
<system.web>
|
||||||
|
<!--
|
||||||
|
In the example below, the "Replace" transform will replace the entire
|
||||||
|
<customErrors> section of your web.config file.
|
||||||
|
Note that because there is only one customErrors section under the
|
||||||
|
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||||
|
|
||||||
|
<customErrors defaultRedirect="GenericError.htm"
|
||||||
|
mode="RemoteOnly" xdt:Transform="Replace">
|
||||||
|
<error statusCode="500" redirect="InternalError.htm"/>
|
||||||
|
</customErrors>
|
||||||
|
-->
|
||||||
|
</system.web>
|
||||||
|
</configuration>
|
31
Recursion/LD_24/Web.Release.config
Normal file
31
Recursion/LD_24/Web.Release.config
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<!-- For more information on using web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||||
|
|
||||||
|
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||||
|
<!--
|
||||||
|
In the example below, the "SetAttributes" transform will change the value of
|
||||||
|
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||||
|
finds an attribute "name" that has a value of "MyDB".
|
||||||
|
|
||||||
|
<connectionStrings>
|
||||||
|
<add name="MyDB"
|
||||||
|
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||||
|
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||||
|
</connectionStrings>
|
||||||
|
-->
|
||||||
|
<system.web>
|
||||||
|
<compilation xdt:Transform="RemoveAttributes(debug)" />
|
||||||
|
<!--
|
||||||
|
In the example below, the "Replace" transform will replace the entire
|
||||||
|
<customErrors> section of your web.config file.
|
||||||
|
Note that because there is only one customErrors section under the
|
||||||
|
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||||
|
|
||||||
|
<customErrors defaultRedirect="GenericError.htm"
|
||||||
|
mode="RemoteOnly" xdt:Transform="Replace">
|
||||||
|
<error statusCode="500" redirect="InternalError.htm"/>
|
||||||
|
</customErrors>
|
||||||
|
-->
|
||||||
|
</system.web>
|
||||||
|
</configuration>
|
18
Recursion/LD_24/Web.config
Normal file
18
Recursion/LD_24/Web.config
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
For more information on how to configure your ASP.NET application, please visit
|
||||||
|
https://go.microsoft.com/fwlink/?LinkId=169433
|
||||||
|
-->
|
||||||
|
<configuration>
|
||||||
|
<system.web>
|
||||||
|
<compilation debug="true" targetFramework="4.7.2" />
|
||||||
|
<httpRuntime targetFramework="4.7.2" />
|
||||||
|
<globalization fileEncoding="utf-8" />
|
||||||
|
</system.web>
|
||||||
|
<system.codedom>
|
||||||
|
<compilers>
|
||||||
|
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
|
||||||
|
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
|
||||||
|
</compilers>
|
||||||
|
</system.codedom>
|
||||||
|
</configuration>
|
4
Recursion/LD_24/packages.config
Normal file
4
Recursion/LD_24/packages.config
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net472" />
|
||||||
|
</packages>
|
25
Recursion/Recursion.sln
Normal file
25
Recursion/Recursion.sln
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.1.32210.238
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LD_24", "LD_24\LD_24.csproj", "{6AAB1A29-81E1-4A08-A8C3-9C203C684B8F}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{6AAB1A29-81E1-4A08-A8C3-9C203C684B8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{6AAB1A29-81E1-4A08-A8C3-9C203C684B8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{6AAB1A29-81E1-4A08-A8C3-9C203C684B8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{6AAB1A29-81E1-4A08-A8C3-9C203C684B8F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {285CDE53-D9E3-4FC7-A17F-A5702B740D70}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
Loading…
Reference in New Issue
Block a user