Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion FizzBuzz/FizzBuzz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,26 @@ class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
for (int i = 1; i <= 100; i++)
{
if (i % 3 == 0 && i % 5 == 0)
{
Console.WriteLine("FizzBuzz");
}
else if (i % 5 == 0)
{
Console.WriteLine("Buzz");
}
else if (i % 3 == 0)
{
Console.WriteLine("Fizz");
}
else
{
Console.WriteLine(i);
}
}

}
}
}
26 changes: 26 additions & 0 deletions Quiz3/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;

namespace Quiz3
{
class Program
{
public static void Main(string[] args)
{
int firstNumb;
int sencondNumb;
Console.WriteLine("Please provide a number:");
firstNumb = Convert.ToInt32(Console.ReadLine());
sencondNumb = Convert.ToInt32(Console.ReadLine());

int sum = Addition(firstNumb + sencondNumb);
}
public static int Addition(int firstNumb , int sencondNumb)
{

return firstNumb + sencondNumb;

}

}

}
8 changes: 8 additions & 0 deletions Quiz3/Quiz3.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

</Project>
69 changes: 69 additions & 0 deletions TextGame/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using System;
using System.Threading;

namespace TextGame
{

class Program
{

static void Main(string[] args)
{
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
Console.WriteLine("Welcome to the cavern of secrets!");
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
Thread.Sleep(1000);
Console.WriteLine("You enter a dark cavern out of curiosity. It is dark and you can only make out a small stick on the floor.");
Console.WriteLine("Do you take it? [y/n]: ");
string ch1 = Console.ReadLine();
string ch2 = Console.ReadLine();
string ch3 = Console.ReadLine();

int stick = 0;
if (ch1 == "y")
{
Console.WriteLine("You have taken the stick!");
Thread.Sleep(2000);
stick = 1;
}
else
{
Console.WriteLine("You did not take the stick");
stick = 0;
Console.WriteLine("As you proceed further into the cave, you see a small glowing object");

}
if (ch2 == "y")
{
Console.WriteLine("You approach the object...");
Thread.Sleep(2000);
Console.WriteLine("As you draw closer, you begin to make out the object as an eye!");
Thread.Sleep(2000);
Console.WriteLine("The eye belongs to a giant spider!");
Console.WriteLine("Do you try to fight it? [Y/N]");
}
if (ch3 == "y")
{
if (stick == 1)
Console.WriteLine("You only have a stick to fight with!");
Console.WriteLine("You quickly jab the spider in it's eye and gain an advantage");
Thread.Sleep(2000);
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
Console.WriteLine(" Fighting... ");
Console.WriteLine(" YOU MUST HIT ABOVE A 5 TO KILL THE SPIDER ");
Console.WriteLine("IF THE SPIDER HITS HIGHER THAN YOU, YOU WILL DIE");
Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
Thread.Sleep(2000);
// Random randomNub = new Random();
// int fdmg1 = Random.Next(3, 11);
// int edmg1 = Random.Next(1, 6);
//the random number gen will not display properly- im getting an error message
Console.WriteLine("you hit a");
Console.WriteLine("the spider hits a");
Thread.Sleep(2000);
}


}
}
}
67 changes: 54 additions & 13 deletions TicTacToe/TicTacToe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public static void Main()
DrawBoard();
GetInput();


} while (!CheckForWin() && !CheckForTie());

// leave this command at the end so your program does not close automatically
Expand All @@ -32,46 +33,86 @@ public static void GetInput()
int row = int.Parse(Console.ReadLine());
Console.WriteLine("Enter Column:");
int column = int.Parse(Console.ReadLine());

PlaceMark(row, column);

// playerTurn == "X" ? playerTurn = "O" : playerTurn = "X";
}

public static void PlaceMark(int row, int column)
public static bool PlaceMark(int row, int column)
{
// your code goes here
}
if (board[row][column] != " ")
{
Console.WriteLine("The row column is already taken");
return false;
}

board[row][column] = playerTurn;

return true;
}
public static bool CheckForWin()
{
// your code goes here
if (HorizontalWin())
{
return true;
}
else if (VerticalWin())
{
return true;
}
else if (DiagonalWin())
{
return true;
}


return false;

}


public static bool CheckForTie()
{
// your code goes here

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkForTie code is missing

return false;
}

public static bool HorizontalWin()
{
// your code goes here

return false;
for (int i = 0; i < board.GetLength(0); i++)
{
for (int j = 0; j < board.GetLength(0) - 1; j++)
{
if (board[i][j] != board[i][j + 1])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the cells of the first row are equal to each other, and they are blank? is that a win?

return false;
}
}
return true;
}

public static bool VerticalWin()
{
// your code goes here

return false;
for (int i = 0; i < board.GetLength(0); i++)
{
for (int j = 0; j < board.GetLength(0) - 1; j++)
{
if (board[j][i] != board[j + 1][i])
return false;
}
}
return true;
}

public static bool DiagonalWin()
{
// your code goes here
if (board[0][2] != board[1][1]) return false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is not correct. what if board[0][2] and board[1][1] are not equal.
But board[0][0], board[1][1] and board[2][2] are equal?

if (board[1][1] != board[2][0]) return false;
if (board[0][0] != board[1][1]) return false;
if (board[1][1] != board[2][2]) return false;

return false;
return true;
}

public static void DrawBoard()
Expand Down
51 changes: 51 additions & 0 deletions Week1-Practice/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System;

namespace Week1_Practice
{
class Program
{
static void Main(string[] args)
{
int input1 = 0;
int input2 = 0;

Console.WriteLine("Give me a number between 0 and 100:");
input1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Give me another number between 0 and 100:");
input2 = Convert.ToInt32(Console.ReadLine());

Console.WriteLine(input1 + input2);

int yardLength = 0;
int inchLength = 0;
Console.WriteLine("Give me a number of yards?");
yardLength = Convert.ToInt32(Console.ReadLine());
inchLength = (yardLength * 36);

Console.WriteLine("You have {0} inches!", inchLength);

bool people = true;
bool f = false;
decimal numb = 0.0M;


string firstName = "DeMarco";
string lastName = "Spears";
int age = 27;
string job = "Client Support Agent";
string favoriteBand = "Beetles";
string favoriteSportsTeam = "Golden State Warriors";


Console.WriteLine("Give me a decimal number?");
numb = Convert.ToDecimal(Console.ReadLine());
Console.WriteLine(numb * numb);
Console.WriteLine("I love sports my favorite team is the {0}", favoriteSportsTeam);
Console.WriteLine("My birthday is on the forth of July, I'm {0} years old!", age);
Console.WriteLine("My favorite band of all time is the {0}!", favoriteBand);
Console.WriteLine("I work at Dell as a {0}!", job);

}
}

}
9 changes: 9 additions & 0 deletions Week1-Practice/Week1-Practice.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RootNamespace>Week1_Practice</RootNamespace>
</PropertyGroup>

</Project>
37 changes: 37 additions & 0 deletions practice3/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;

namespace practice3
{
class Program
{
static void Main(string[] args)
{
String[] names = new String[4];
//james
//mike
// adam
// jane

name[0] = "james";
nameo[1] = "mike";
name[2] = "adam";
name[3] = "jane";

String[] pets = { "Rocky","Walter", "Bailey"};
String[] cities;
cities = new String[] {"Austin", "Dallas", "Houston"};

Console.WriteLine("In the array of size {0}, {1} is at index {2}"),
sizeOfArry, lastName, lastIndex);

if(names[0] == "James")
{
Console.WriteLine("James is in posistion 0");
} else if(names[1])

{

}
}
}
}
8 changes: 8 additions & 0 deletions practice3/practice3.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

</Project>