Initial commit

This commit is contained in:
github-classroom[bot] 2024-09-12 13:45:20 +00:00 committed by GitHub
commit 0119dae9ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 4360 additions and 0 deletions

14
SimpleDrawings/Program.cs Normal file
View file

@ -0,0 +1,14 @@
using System.Text;
using LeoTurtle;
using SimpleDrawings;
Console.OutputEncoding = Encoding.UTF8;
Console.WriteLine("*** Simple Drawing ***");
Beach.Prepare<Turtle>(WalkPath, 50, 50);
static void WalkPath(Turtle turtle)
{
TurtlePath.Walk(turtle);
}

View file

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HTLLeonding.Utility.Turtle" Version="1.1.0" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,96 @@
using LeoTurtle;
namespace SimpleDrawings;
public static class TurtlePath
{
/// <summary>
/// Executes the logic for adding turtle path steps.
/// Called automatically when the application starts.
/// </summary>
/// <param name="turtle">The <see cref="Turtle"/> instance to use</param>
public static void Walk(Turtle turtle)
{
EulerianPath(turtle);
Shapes(turtle);
}
/// <summary>
/// Draws a 'Haus des Nikolaus' as an Eulerian path
/// </summary>
/// <param name="turtle">The <see cref="Turtle"/> instance to use</param>
private static void EulerianPath(Turtle turtle)
{
const double Distance = 6.0D;
const double ShortDistance = 4.24D;
const double LongDistance = 8.49D;
// TODO
}
/// <summary>
/// Draws several shapes.
/// </summary>
/// <param name="turtle">The <see cref="Turtle"/> instance to use</param>
private static void Shapes(Turtle turtle)
{
// TODO
}
/// <summary>
/// Draws an octagon.
/// </summary>
/// <param name="turtle">The <see cref="Turtle"/> instance to use</param>
/// <param name="startX">Initial turtle x position when starting to draw</param>
/// <param name="startY">Initial turtle y position when starting to draw</param>
private static void DrawOctagon(Turtle turtle, int startX, int startY)
{
// TODO
}
/// <summary>
/// Draws a rhombus.
/// </summary>
/// <param name="turtle">The <see cref="Turtle"/> instance to use</param>
/// <param name="startX">Initial turtle x position when starting to draw</param>
/// <param name="startY">Initial turtle y position when starting to draw</param>
private static void DrawRhombus(Turtle turtle, int startX, int startY)
{
// TODO
}
/// <summary>
/// Draws two triangles, one offset off the other.
/// </summary>
/// <param name="turtle">The <see cref="Turtle"/> instance to use</param>
/// <param name="startX">Initial turtle x position when starting to draw</param>
/// <param name="startY">Initial turtle y position when starting to draw</param>
private static void DrawTriangle(Turtle turtle, int startX, int startY)
{
// TODO
}
/// <summary>
/// Draws a single triangle at the given position and with the given size.
/// Angels are fixed.
/// </summary>
/// <param name="turtle">The <see cref="Turtle"/> instance to use</param>
/// <param name="startX">Initial turtle x position when starting to draw</param>
/// <param name="startY">Initial turtle y position when starting to draw</param>
/// <param name="longSide">Length of the side c</param>
/// <param name="shortSide">Length of sides a & b</param>
private static void DrawTriangle(Turtle turtle, double startX, double startY, double longSide, double shortSide)
{
// TODO
}
/// <summary>
/// Converts an angel from degrees to radians.
/// </summary>
/// <param name="angleDegrees">Degrees to convert</param>
/// <returns>Radians value</returns>
private static double ConvertToRadians(double angleDegrees)
{
return angleDegrees * Math.PI / 180;
}
}