Skip to content

jhannes/kata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

Coding exercises for practicing programming skills

Number as words

Translate from integers to words in a chosen language. E.g. number_as_words(1028) => "one thousand and twenty eight"

C#

Rust

Translate messages

Translate messages with different arguments to different user languages. E.g. showMessage(english, { code: "illegalEmail", email: "foo-at-bar.com" }) should return "The email address foo-at-bar.com is formatted invalid"

Typescript

This exercise lends itself very well to Typescript with the concept of discriminated unions.

Minesweeper

Based on the simple computer game minesweeper. Given a field with mines placed, calculate the hints to show players.

This exercise requires some data structures, looping and conditional logic without conceptual complexity.

Java

C#

Starting points

C# with dotnet core

Download dotnet SDK and Visual Studio Code.

Details
  1. dotnet new sln (In a new empty directory)
  2. dotnet new classlib -o <project>
  3. dotnet sln add <project>
  4. dotnet new xunit -o <project>.Tests
  5. dotnet sln add <project>.Tests
  6. cd <project>.Tests
  7. dotnet add reference ../<project>
  8. dotnet watch test

Vitest with Typescript

Install NodeJs

Details
  1. npm init -y (In a new empty directory)
  2. npm install --save-dev husky typescript prettier vitest
  3. npx tsc --init
  4. npx husky init
  5. npm pkg set type=module
  6. npm pkg set scripts.test="tsc --noEmit && vitest --run && prettier --check ."
  7. npm pkg set scripts.test:watch="vitest"
  8. Create <...>.test.ts with test("...", () => { expect(...).toBe(...))})
  9. npm run test:watch

Rust

Install Rust from https://www.rust-lang.org/learn/get-started

Details
  1. Create project: cargo init (In a new empty directory)
  2. Create a test file as tests/..._test.rs
  3. Run tests cargo watch -x test

About

Coding exercises and demonstrations of test-driven development and pair programming

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •