Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solutions for Fizzbuzz, BerlinClock and RomanNumerals #3

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,16 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# Python specific files
__pycache__/
*.py[cod]
*$py.class

**/bin/
**/include/
**/lib/
**/lib64/
**/share/

**/dist*
23 changes: 23 additions & 0 deletions katas/BerlinClock/solution/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'plugin:react/recommended',
'standard-with-typescript'
],
overrides: [
],
parserOptions: {
project: ['./tsconfig.json'],
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: [
'react'
],
rules: {
"react/react-in-jsx-scope": "off"
}
}
25 changes: 25 additions & 0 deletions katas/BerlinClock/solution/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Readme Berlin clock

this solves this Berlin Clock kata ov adva-store.

## installation:

Run `npm i` to install all required dependencies.

## Start

To use the dev version execute `npm run dev`. The Berlin Clock is available under `localhost:5173`.

To check the prod build first run `nom run build` to build the app and afterwards `npn run preview` to serve it on `localhost:4173`


## Code organisation

The main component cna be found in `src/clock` while the serice providing the time can be found `src/timeService.ts`

## Notes

Obbiously this challange could also be completed using vanilla JS (or any other framework), but Idecided to refresh my React
kwnoledge because I didn't use it for quite a while.
Also using RxJs may look over-engineered and the number of external depenncies (or for some additional complexety) could be
reduced by relying on `setInterval` instead.
13 changes: 13 additions & 0 deletions katas/BerlinClock/solution/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading