mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 23:26:40 -08:00
Sine Wave in C#
This commit is contained in:
25
78 Sine Wave/csharp/SineWave/SineWave.sln
Normal file
25
78 Sine Wave/csharp/SineWave/SineWave.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31005.135
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SineWave", "SineWave\SineWave.csproj", "{B316DD7F-5755-4216-AFDC-D83720F8ACA2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B316DD7F-5755-4216-AFDC-D83720F8ACA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B316DD7F-5755-4216-AFDC-D83720F8ACA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B316DD7F-5755-4216-AFDC-D83720F8ACA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B316DD7F-5755-4216-AFDC-D83720F8ACA2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {32A37343-2955-4124-8765-9143F6C529DC}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
15
78 Sine Wave/csharp/SineWave/SineWave/Program.cs
Normal file
15
78 Sine Wave/csharp/SineWave/SineWave/Program.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
Console.WriteLine(Tab(30) + "Sine Wave");
|
||||
Console.WriteLine(Tab(15) + "Creative Computing Morristown, New Jersey\n\n\n\n\n");
|
||||
|
||||
bool isCreative = true;
|
||||
for (double t = 0.0; t <= 40.0; t += 0.25)
|
||||
{
|
||||
int a = (int)(26 + 25 * Math.Sin(t));
|
||||
string word = isCreative ? "Creative" : "Computing";
|
||||
Console.WriteLine($"{Tab(a)}{word}");
|
||||
isCreative = !isCreative;
|
||||
}
|
||||
|
||||
static string Tab(int n) => new string(' ', n);
|
||||
8
78 Sine Wave/csharp/SineWave/SineWave/SineWave.csproj
Normal file
8
78 Sine Wave/csharp/SineWave/SineWave/SineWave.csproj
Normal file
@@ -0,0 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user