Skip to content
Snippets Groups Projects
Commit 3d2b924e authored by Love Arreborn's avatar Love Arreborn
Browse files

small edits

parent 47f1a8e3
No related branches found
No related tags found
No related merge requests found
# 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
## JavaScript (README-javascript.md)
````markdown
# JavaScript # JavaScript
## How to Run ## How to Run
1. Ensure Node.js is installed (check with `node --version`). 1. Ensure Node.js is installed (check with `node --version`).
- If not, install node (`sudo apt-get install nodejs`)
2. Run the file with: 2. Run the file with:
```bash ```bash
node example.js node example.js
``` ```
````
...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
## How to Run ## How to Run
1. Ensure TypeScript is installed (check with `tsc --version`). 1. Ensure Node.js is installed (check with `node --version`).
2. Compile the file: - If not, install node (`sudo apt-get install nodejs`)
2. Install TypeScript through Node (`npm install typescript --save-dev`)
3. Compile the file:
```bash ```bash
tsc example.ts npx tsc example.ts
``` ```
3. Run the resulting JavaScript-file: 4. Run the resulting JavaScript-file:
``` ```
node example.js node example.js
``` ```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment