Translate from integers to words in a chosen language. E.g.
number_as_words(1028) => "one thousand and twenty eight"
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"
This exercise lends itself very well to Typescript with the concept of discriminated unions.
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.
Download dotnet SDK and Visual Studio Code.
Details
dotnet new sln(In a new empty directory)dotnet new classlib -o <project>dotnet sln add <project>dotnet new xunit -o <project>.Testsdotnet sln add <project>.Testscd <project>.Testsdotnet add reference ../<project>dotnet watch test
Install NodeJs
Details
npm init -y(In a new empty directory)npm install --save-dev husky typescript prettier vitestnpx tsc --initnpx husky initnpm pkg set type=modulenpm pkg set scripts.test="tsc --noEmit && vitest --run && prettier --check ."npm pkg set scripts.test:watch="vitest"- Create
<...>.test.tswithtest("...", () => { expect(...).toBe(...))}) npm run test:watch
Install Rust from https://www.rust-lang.org/learn/get-started
Details
- Create project:
cargo init(In a new empty directory) - Create a test file as tests/..._test.rs
- Run tests
cargo watch -x test