diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..56caf3860cbe96cfea400d1d48031b7ed8737f16 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# Language repository + +This repository contains small examples for a simple function in several +different programming languages. Feel free to play around with them, and modify +them somehow! + +## Change ideas + +Here are some examples of how you can try to play around with these languages. +What you decide to do is entirely up to you! These are just some examples for +you to take inspiration from. + +- Change the manipulate-function to only add items if the value is even +- Change the manipulate-function to print the values while adding them +- Implement Fizz Buzz: + - A function takes a container with integers + - Loop through the container + - If the value is evenly sivisible with 3 and 5: + - Print "Fizz Buzz" + - If the value is only evenly divisible with 3: + - Print "Fizz" + - If the value is only evenly divisible with 5: + - Print "Buzz" + - Else, print the number itself +- Take the container of integers, and returns the same values in a new container + but converted to strings diff --git a/javascript/README.md b/javascript/README.md index a8a2ba4ed5c7d6d43c8653ab22d1d56052f6b8bb..c3d5b24126fea5c5eb41cb7b831fee241aab0b4e 100644 --- a/javascript/README.md +++ b/javascript/README.md @@ -1,13 +1,10 @@ -## JavaScript (README-javascript.md) - -````markdown # JavaScript ## How to Run 1. Ensure Node.js is installed (check with `node --version`). + - If not, install node (`sudo apt-get install nodejs`) 2. Run the file with: ```bash node example.js ``` -```` diff --git a/typescript/README.md b/typescript/README.md index c4456bfe0a79a3abe20f12cdd3c0ac580b12d6f1..631cb775226be8c98ec6cd54877a2c7eed911ea9 100644 --- a/typescript/README.md +++ b/typescript/README.md @@ -2,12 +2,14 @@ ## How to Run -1. Ensure TypeScript is installed (check with `tsc --version`). -2. Compile the file: +1. Ensure Node.js is installed (check with `node --version`). + - If not, install node (`sudo apt-get install nodejs`) +2. Install TypeScript through Node (`npm install typescript --save-dev`) +3. Compile the file: ```bash - tsc example.ts + npx tsc example.ts ``` -3. Run the resulting JavaScript-file: +4. Run the resulting JavaScript-file: ``` node example.js ```