mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
Simplfy SineWave (C#) folder structure
This commit is contained in:
15
78_Sine_Wave/csharp/Program.cs
Normal file
15
78_Sine_Wave/csharp/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);
|
||||
Reference in New Issue
Block a user