Tests

22
Apr

Refactorings: It's all on GitHub

Alle Refactoring Beispiele und Übungen sind nun genau wie die Katas auf GitHub verfügbar! Zusätzlich zu den hier veröffentlichen Beispielen sind auch neue Übungen z.b. Papagei, Tennis, TicTacToe etc. hinzugekommen.

1
Jan

Fizz Buzz Sample Python Code

Code:

def FizzBuzz(value):
    result = ""
    if value <= 0:
        return result

    if value % 3 == 0:
        result += "fizz"
    if value % 5 == 0:
        result += "buzz"
    if not result:
        result += str(value)

    return result
1
Jan

String Calculator Sample Python Code

1
Jan

OddEven Sample Python Code

24
Nov

OddEven Sample TypeScript Code

24
Nov

ABC Problem Sample C# Code

Code:

public class ABCProblem
{
    private readonly IEnumerable<string> m_Blocks;

    public ABCProblem()
    {
        m_Blocks = new List<string>
        {
9
Nov

Fizz Buzz Sample C++ Code

9
Nov

Fizz Buzz Sample TypeScript Code

Code:

class FizzBuzz {
    
    doFizzBuzz(value: number) : string {

        var result = "";
        if (value <= 0) return result;

        if (value % 3 === 0) result = "fizz";
        if (value % 5 === 0) result += "buzz";
15
Sep

Harry Potter Sample C# Code

15
Sep

Goldbachs Conjecture C# Code

Code:

public class GoldbachsConjecture
{
    public IEnumerable<int[]> TwoPrimeCalculation(int number)
    {
        if (number < 3 || number%2 != 0) return null;
8
Sep

Odd Even Sample C# Code

24
Jul

Mathematical Expression Parser Sample C# Code

Code:

    public class Calc
    {
        private readonly NodeFactory m_NodeFactory;

        public Calc()
        {
            m_NodeFactory = new NodeFactory();
            m_NodeFactory.Register("+", typeof(AdditionNode));
10
Sep

String Calculator Sample C# Code

Code:

    public class StringCalculator
    {
        public int Add(string numbers, char seperator)
        {
            int result = 0;
            if (String.IsNullOrEmpty(numbers)) return result;
10
Sep

Fizz Buzz Sample C# Code

Code:

    public class FizzBuzz
    {
        public string DoFizzBuzz(uint value)
        {
            string result = string.Empty;
            if (value == 0) return result;
10
Sep

Roman Numerals Sample C# Code

Code:

    public class RomanNumbers
    {
        private readonly IDictionary<string, int> m_RomanNumbers;

        public RomanNumbers()
        {
10
Sep

Lucky Numbers Sample C# Code