This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string ShorterReverseLonger(string a, string b) | |
{ | |
if(a == null)a = "" ; | |
if (b == null) b = ""; | |
return (a.Length > b.Length || a.Length == b.Length) ? b + new string(a.ToCharArray().Reverse().ToArray()) + b : a + b.Reverse() + a; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace MatrixAssignment | |
{ | |
class Matrix | |
{ | |
public static int[,] CreateGrid(int rows, int cols) | |
{ | |
int[,] grid = new int[rows, cols]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
print(" Hey lets play a game!") | |
print("\n I'm' thinking of a number between 1 and 20.") | |
print('\n You have 5 turns to guess my number or you lose.') | |
raw_input("\n Press RETURN when you're ready go play .") | |
test = 0 | |
num = randint(1, 20) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web; | |
namespace WarCardGame | |
{ | |
class Dealer | |
{ | |
Random rand = new Random(); | |
public void DealPlayersDeck(Deck cards, Dictionary<int, string> humanDeck, Dictionary<int, string> computerDeck) | |
{ | |
var fullDeck = cards.CreateNewDeck(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Deck | |
{ | |
public Dictionary<int, string> CreateNewDeck() | |
{ | |
Dictionary<int, string> newDeck = new Dictionary<int, string>() | |
{ | |
{1, "~/cards/c1.png"}, {2, "~/cards/c2.png"}, {3, "~/cards/c3.png"}, {4, "~/cards/c4.png"}, | |
{5, "~/cards/c5.png"}, {6, "~/cards/c6.png"}, {7, "~/cards/c7.png"}, {8, "~/cards/c8.png"}, | |
{9, "~/cards/c9.png"}, {10, "~/cards/c10.png"}, {11, "~/cards/cj.png"}, {12, "~/cards/cq.png"}, {13, "~/cards/ck.png"}, | |
{14, "~/cards/d1.png"}, {15, "~/cards/d2.png"}, {16, "~/cards/d3.png"}, {17, "~/cards/d4.png"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Yo fool! whats your name?") | |
user_name = input() | |
print("OK Trainer: {0}, so you want to be a pokemon master huh?".format(user_name.upper())) | |
print("This is gonna be a fun filled adventure mixed hard work!") | |
print("Are you sure this is what you want?") | |
print("-----------------------------------------------------") | |
print("(Yes) or (No)") | |
yes_or_no = input().upper() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ChallengePostalCalculator | |
{ | |
public partial class Default : System.Web.UI.Page | |
{ | |
protected void Page_Load(object sender, EventArgs e) | |
{ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Windows.Forms; | |
using System.IO; | |
namespace Bethel_DFWMessageTool | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Windows.Forms; | |
using System.IO; | |
namespace WindowsFormsApplication1 | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import choice | |
import console | |
choices = ['rock', 'paper', 'scissors'] | |
def design(): | |
print('*********************************') | |
def winning_message(player_choice, computer_choice): | |
player_score = 0 |