From 55a4e0346963c3c88ea9e44fa58202662871c934 Mon Sep 17 00:00:00 2001 From: Louka Lemonnier Date: Mon, 7 Oct 2024 13:58:35 +0200 Subject: [PATCH 1/4] feat: ajout d'un auteur --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index f94fe00..ce7002a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,8 +1,11 @@ # This is the list of MapSCII authors for copyright purposes. + # + Michael Straßburger Christian Paul (https://chrpaul.de) Jannis R Alexander Zhukov (https://github.com/ZhukovAlexander) Quincy Morgan (https://github.com/quincylvania) lennonhill (https://github.com/lennonhill) +Benoit Champaret (https://github.com/bchamparex) From 3ed393e13da96fd9c9687762312451b49c2f30ca Mon Sep 17 00:00:00 2001 From: mariloumars Date: Mon, 7 Oct 2024 13:58:50 +0200 Subject: [PATCH 2/4] Update Support.md --- .github/ISSUE_TEMPLATE/Support.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/Support.md b/.github/ISSUE_TEMPLATE/Support.md index 21f1028..e383f42 100644 --- a/.github/ISSUE_TEMPLATE/Support.md +++ b/.github/ISSUE_TEMPLATE/Support.md @@ -5,6 +5,8 @@ about: I want to support efforts in maintaining this community-driven project --------------^ Click “Preview”! +I love Nutty Mac Nut, and his big balls of steel + Developing and maintaining an open source project is a big effort. MapSCII isn’t supported by any big company, and all the contributors are working on it in their free time. We need your help to make it sustainable. There are many ways you can help: From 66934e4ac692f81b353772bcd27620c93d919aff Mon Sep 17 00:00:00 2001 From: margouillat Date: Mon, 7 Oct 2024 13:57:17 +0200 Subject: [PATCH 3/4] braille buffer --- src/BrailleBuffer.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/BrailleBuffer.js b/src/BrailleBuffer.js index 5b09081..bf44c13 100644 --- a/src/BrailleBuffer.js +++ b/src/BrailleBuffer.js @@ -19,11 +19,11 @@ const utils = require('./utils'); const asciiMap = { // '▬': [2+32, 4+64], // '¯': [1+16], - '▀': [1+2+16+32], - '▄': [4+8+64+128], - '■': [2+4+32+64], - '▌': [1+2+4+8], - '▐': [16+32+64+128], + '8': [1 + 2 + 16 + 32], + '▄': [4 + 8 + 64 + 128], + '■': [2 + 4 + 32 + 64], + '▌': [1 + 2 + 4 + 8], + '▐': [16 + 32 + 64 + 128], // '▓': [1+4+32+128, 2+8+16+64], '█': [255], }; @@ -31,7 +31,7 @@ const termReset = '\x1B[39;49m'; class BrailleBuffer { constructor(width, height) { - this.brailleMap = [[0x1, 0x8],[0x2, 0x10],[0x4, 0x20],[0x40, 0x80]]; + this.brailleMap = [[0x1, 0x8], [0x2, 0x10], [0x4, 0x20], [0x40, 0x80]]; this.pixelBuffer = null; this.charBuffer = null; @@ -45,7 +45,7 @@ class BrailleBuffer { this.width = width; this.height = height; - const size = width*height/8; + const size = width * height / 8; this.pixelBuffer = Buffer.alloc(size); this.foregroundBuffer = Buffer.alloc(size); this.backgroundBuffer = Buffer.alloc(size); @@ -86,7 +86,7 @@ class BrailleBuffer { } _project(x, y) { - return (x>>1) + (this.width>>1)*(y>>2); + return (x >> 1) + (this.width >> 1) * (y >> 2); } _locate(x, y, cb) { @@ -118,7 +118,7 @@ class BrailleBuffer { const results = []; for (i = k = 1; k <= 255; i = ++k) { const braille = (i & 7) + ((i & 56) << 1) + ((i & 64) >> 3) + (i & 128); - results.push(this.asciiToBraille[i] = masks.reduce((function(best, mask) { + results.push(this.asciiToBraille[i] = masks.reduce((function (best, mask) { const covered = utils.population(mask.mask & braille); if (!best || best.covered < covered) { return { @@ -151,11 +151,11 @@ class BrailleBuffer { let currentColor = null; let skip = 0; - for (let y = 0; y < this.height/4; y++) { + for (let y = 0; y < this.height / 4; y++) { skip = 0; - for (let x = 0; x < this.width/2; x++) { - const idx = y*this.width/2 + x; + for (let x = 0; x < this.width / 2; x++) { + const idx = y * this.width / 2 + x; if (idx && !x) { output.push(config.delimeter); @@ -168,14 +168,14 @@ class BrailleBuffer { const char = this.charBuffer[idx]; if (char) { - skip += stringWidth(char)-1; - if (skip+x < this.width/2) { + skip += stringWidth(char) - 1; + if (skip + x < this.width / 2) { output.push(char); } } else { if (!skip) { if (config.useBraille) { - output.push(String.fromCharCode(0x2800+this.pixelBuffer[idx])); + output.push(String.fromCharCode(0x2800 + this.pixelBuffer[idx])); } else { output.push(this.asciiToBraille[this.pixelBuffer[idx]]); } @@ -186,7 +186,7 @@ class BrailleBuffer { } } - output.push(termReset+config.delimeter); + output.push(termReset + config.delimeter); return output.join(''); } @@ -200,10 +200,10 @@ class BrailleBuffer { writeText(text, x, y, color, center = true) { if (center) { - x -= text.length/2+1; + x -= text.length / 2 + 1; } for (let i = 0; i < text.length; i++) { - this.setChar(text.charAt(i), x+i*2, y, color); + this.setChar(text.charAt(i), x + i * 2, y, color); } } } From ab7708bdc75338a68df5b19090bc77910fc2d633 Mon Sep 17 00:00:00 2001 From: Ota Date: Mon, 7 Oct 2024 13:59:02 +0200 Subject: [PATCH 4/4] feat: add toto --- toto.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 toto.txt diff --git a/toto.txt b/toto.txt new file mode 100644 index 0000000..90848a5 --- /dev/null +++ b/toto.txt @@ -0,0 +1 @@ +youhou \ No newline at end of file