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

added .nvmrc file to change node version #1

Open
wants to merge 3 commits into
base: master
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
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11.15.0
Binary file added bild.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 14 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* WORLD MAP VISUALIZER
* Author: <your name here>
* Author: Marc Rufeis
* ---------------------------
*
* Visualizing the world!
Expand All @@ -24,28 +24,29 @@

const rl = require('readline')
const jimp = require('jimp')
const chalk = require('chalk');

clearConsole()

jimp.read('world.jpg', (err, map_image) => {
jimp.read('prag.jpg', (err, map_image) => {
if (err) throw err;
map_image.resize(100,50);
console.log(map_image.getPixelColor(0,0)); //gibt die Farbe des Pixels links oben zurück
writeCharacterToConsole('#',0,0); //schreibt ein # links oben in die Konsole

//----- Hier kommt euer Code hin -----


const terminal_width = process.stdout.columns;
const terminal_height = process.stdout.rows;
map_image.resize(terminal_width, terminal_height);

for (let x = 0; x <= terminal_width; x++) {
for (let y = 0; y <= terminal_height; y++) {
const color = jimp.intToRGBA(map_image.getPixelColor(x, y))
writeCharacterToConsole(chalk.rgb(color.r, color.g, color.b)('■'), x, y);
}
}
});



//Vorerst nur ein Platzhalter
setInterval(function () {

},1000);

}, 1000);

/*
* HELPER FUNCTIONS - DO NOT CHANGE
Expand All @@ -59,6 +60,6 @@ function clearConsole () {
}

function writeCharacterToConsole (char, x, y) {
rl.cursorTo(process.stdout,x,y)
rl.cursorTo(process.stdout, x, y)
process.stdout.write(char)
}
Binary file added max.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added node.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
"license": "MIT",
"dependencies": {
"chai": "1.9.1",
"chalk": "^3.0.0",
"gulp": "^3.9.0",
"gulp-eslint": "^2.0.0",
"jimp": "^0.8.5",
"lodash": "4.17.15",
"mocha": "1.21.4",
"jimp": "^0.8.5"
"mocha": "1.21.4"
}
}
Binary file added prag.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added steve.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.