Skip to content

Commit

Permalink
Hourglass
Browse files Browse the repository at this point in the history
  • Loading branch information
elad770 committed Sep 10, 2023
1 parent 016b443 commit c96d1d1
Show file tree
Hide file tree
Showing 19 changed files with 229 additions and 0 deletions.
Binary file added Hourglass/.vs/Hourglass/v17/.suo
Binary file not shown.
25 changes: 25 additions & 0 deletions Hourglass/Hourglass.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32804.467
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hourglass", "Hourglass\Hourglass.csproj", "{91DD59A1-03EE-45D3-A4B1-0737D1A06C71}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{91DD59A1-03EE-45D3-A4B1-0737D1A06C71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91DD59A1-03EE-45D3-A4B1-0737D1A06C71}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91DD59A1-03EE-45D3-A4B1-0737D1A06C71}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91DD59A1-03EE-45D3-A4B1-0737D1A06C71}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {75F67AF3-B2E0-4BA1-995F-F6E3379CBC66}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions Hourglass/Hourglass/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
53 changes: 53 additions & 0 deletions Hourglass/Hourglass/Hourglass.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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>
<ProjectGuid>{91DD59A1-03EE-45D3-A4B1-0737D1A06C71}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Hourglass</RootNamespace>
<AssemblyName>Hourglass</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</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|AnyCPU' ">
<PlatformTarget>AnyCPU</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.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
89 changes: 89 additions & 0 deletions Hourglass/Hourglass/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hourglass
{
internal class Program
{

static void DrawHourglass(int rows)
{
if (rows % 2 != 1)
{
rows++;
}
int totalColunm = rows;
int x = 0;
for (int i = 0; i < rows; i++)
{
Console.Write("\t\t");
for (int j = 0; j < rows; j++)
{
if (j % 2 == 0 && (i == 0 || i == rows - 1) || j == i || j == totalColunm - i - 1)
{
Console.Write("*");
}
else
{
Console.Write(" ");
}
}

Console.WriteLine();
}

}


static void DrawHourglass2(int rows)
{
if (rows % 2 != 1)
{
rows++;
}
int totalColunm = rows;
int x = 0;
for (int i = 0; i <= rows; i++)
{
Console.Write("\t\t");
for (int j = 0; j < totalColunm; j++)
{
if (j >= x)
{
Console.Write("*");
}
else
{
Console.Write(" ");
}
}
if (i < rows / 2)
{
totalColunm--;
x++;
}
else if (i > rows / 2)
{
totalColunm++;
x--;
}
Console.WriteLine();
}

}


static void Main(string[] args)
{
Console.ForegroundColor = ConsoleColor.Red;
DrawHourglass2(22);
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.Green;
DrawHourglass(22);

}
}
}
36 changes: 36 additions & 0 deletions Hourglass/Hourglass/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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("Hourglass")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Hourglass")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[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("91dd59a1-03ee-45d3-a4b1-0737d1a06c71")]

// 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 Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file added Hourglass/Hourglass/bin/Debug/Hourglass.exe
Binary file not shown.
6 changes: 6 additions & 0 deletions Hourglass/Hourglass/bin/Debug/Hourglass.exe.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
Binary file added Hourglass/Hourglass/bin/Debug/Hourglass.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7f4b213b428f4c013f19137338418ee1f5525793
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
C:\Users\Elad\source\repos\Shapes\Hourglass\Hourglass\bin\Debug\Hourglass.exe.config
C:\Users\Elad\source\repos\Shapes\Hourglass\Hourglass\bin\Debug\Hourglass.exe
C:\Users\Elad\source\repos\Shapes\Hourglass\Hourglass\bin\Debug\Hourglass.pdb
C:\Users\Elad\source\repos\Shapes\Hourglass\Hourglass\obj\Debug\Hourglass.csproj.AssemblyReference.cache
C:\Users\Elad\source\repos\Shapes\Hourglass\Hourglass\obj\Debug\Hourglass.csproj.SuggestedBindingRedirects.cache
C:\Users\Elad\source\repos\Shapes\Hourglass\Hourglass\obj\Debug\Hourglass.csproj.CoreCompileInputs.cache
C:\Users\Elad\source\repos\Shapes\Hourglass\Hourglass\obj\Debug\Hourglass.exe
C:\Users\Elad\source\repos\Shapes\Hourglass\Hourglass\obj\Debug\Hourglass.pdb
Empty file.
Binary file added Hourglass/Hourglass/obj/Debug/Hourglass.exe
Binary file not shown.
Binary file added Hourglass/Hourglass/obj/Debug/Hourglass.pdb
Binary file not shown.
1 change: 1 addition & 0 deletions Hourglass/Hourglass/obj/Debug/_IsIncrementalBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj\Debug\\_IsIncrementalBuild
Binary file modified RhombusShape/.vs/RhombusShape/v17/.suo
Binary file not shown.

0 comments on commit c96d1d1

Please sign in to comment.