Last active
February 25, 2019 23:36
-
-
Save SamyBencherif/1e5ba023171116de13da109cd13f3d6b to your computer and use it in GitHub Desktop.
SCRIPT-8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| In case you were wondering what a cube would look like on this screen. | |
| Not very appealing.. maybe it's not worth the effort to write a renderer. | |
| Luckily I just made a bitmap drawer. | |
| But also I just realized this program has an "ART" tab. | |
| ehh3ihihef whatever. | |
| */ | |
| function StoInt(s) | |
| { | |
| if (s==' ') return 7 | |
| return s.charCodeAt(0)-48; | |
| } | |
| function fdiv(a,b) | |
| { | |
| return Math.floor(a/b) | |
| } | |
| function drawBmp(bmp,s) | |
| { | |
| var arr = []; | |
| for (var r of bmp.split('\n')) | |
| { | |
| if (r=='') continue | |
| var row = []; | |
| for (var x of r.split('')) | |
| { | |
| row.push(StoInt(x)) | |
| } | |
| arr.push(row) | |
| } | |
| for (var x=0; x<arr[0].length*s; x++) | |
| { | |
| for (var y=0; y<arr.length*s; y++) | |
| { | |
| setPixel(x,y,arr[fdiv(y,s)][fdiv(x,s)]) | |
| } | |
| } | |
| } | |
| const bmp = ` | |
| 1222222222222222 | |
| 1222222222222222 | |
| 12222222222222222 | |
| 11222222222222222 | |
| 112222222222222222 | |
| 112222222222222222 | |
| 111222222222222222 | |
| 111222222222222222 | |
| 1112222222222222222 | |
| 1111222222222222222 | |
| 1111333333333333333 | |
| 1111333333333333333 | |
| 1111333333333333333 | |
| 1111333333333333333 | |
| 1111333333333333333 | |
| 111333333333333333 | |
| 111333333333333333 | |
| 111333333333333333 | |
| 111333333333333333 | |
| 11333333333333333 | |
| 11333333333333333 | |
| 1333333333333333 | |
| 1333333333333333 | |
| 1333333333333333 | |
| 333333333333333 | |
| ` | |
| draw = () => { | |
| clear() | |
| drawBmp(bmp,4) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "lines": [ | |
| 86, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0, | |
| 0 | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "0": [ | |
| "22222 ", | |
| "222222 ", | |
| "322222 ", | |
| "3300000 ", | |
| "3300000 ", | |
| "3300000 ", | |
| " 300000 ", | |
| " ", | |
| 0 | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment