View test.py
This file contains 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 typing import Callable | |
import inspect | |
class Test: | |
def __init__(self): | |
self._callback = self._passthrough | |
@staticmethod | |
def _passthrough(data, headers, *args): |
View SlidingPuzzle.cs
This file contains 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.Linq; | |
namespace SlidingPuzzle | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.Clear(); |
View Sokoban.cs
This file contains 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; | |
using System.IO; | |
using System.Linq; | |
namespace Sokoban | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
View SnakeInConsole.cs
This file contains 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; | |
using System.Diagnostics; | |
using System.Linq; | |
namespace Snake | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
View BoardChecks.cs
This file contains 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 Microsoft.VisualStudio.TestTools.UnitTesting; | |
using ConnectFour; | |
namespace ConnectFourTests | |
{ | |
[TestClass] | |
public class BoardChecks | |
{ | |
[TestMethod] | |
public void FourInARow_AtTheBeginning() |
View TicTacToe.cs
This file contains 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; | |
using System.Linq; | |
namespace TicTacToe | |
{ | |
class Program | |
{ | |
static void Main() | |
{ |
View Battleship.cs
This file contains 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 Program | |
{ | |
static void Main(string[] args) | |
{ | |
var boardGenerator = new BoardGenerator(); | |
var board = boardGenerator.GetBoard(10, new[] {new ShipDetails(4, 1), new ShipDetails(3, 2), new ShipDetails(2, 3), new ShipDetails(1, 4)}); | |
PrintBoard(board); | |
Console.ReadLine(); | |
} |
View Minesweeper.cs
This file contains 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.Text; | |
namespace Minesweeper | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.OutputEncoding = Encoding.UTF8; |
View Semiprime.cs
This file contains 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 class Semiprime | |
{ | |
static public bool Semiprime1(int number) | |
{ | |
var divisors = new List<int>(); | |
for (var i = 2; i <= Math.Sqrt(number); i++) | |
{ | |
if (number % i == 0) | |
{ |