Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tdp007-lang-examples
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Love Arreborn
tdp007-lang-examples
Commits
3d2b924e
Commit
3d2b924e
authored
4 months ago
by
Love Arreborn
Browse files
Options
Downloads
Patches
Plain Diff
small edits
parent
47f1a8e3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+26
-0
26 additions, 0 deletions
README.md
javascript/README.md
+1
-4
1 addition, 4 deletions
javascript/README.md
typescript/README.md
+6
-4
6 additions, 4 deletions
typescript/README.md
with
33 additions
and
8 deletions
README.md
0 → 100644
+
26
−
0
View file @
3d2b924e
# 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
This diff is collapsed.
Click to expand it.
javascript/README.md
+
1
−
4
View file @
3d2b924e
## 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
```
```
````
This diff is collapsed.
Click to expand it.
typescript/README.md
+
6
−
4
View file @
3d2b924e
...
@@ -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
```
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment