Skip to content

Instantly share code, notes, and snippets.

@ryu1-1uyr
Created May 6, 2020 02:14
Show Gist options
  • Save ryu1-1uyr/5ac24f8eaeb6f0a63bf56d778c8e45ca to your computer and use it in GitHub Desktop.
Save ryu1-1uyr/5ac24f8eaeb6f0a63bf56d778c8e45ca to your computer and use it in GitHub Desktop.
jikosyoukai
// let ryu = `
// ⬛⬜⬛⬛⬛⬜⬛⬜⬜⬜⬜⬛⬜⬜⬛⬜⬜⬜⬛⬛ [0] / [0,2,3,4,6,11,14,18,19]
// ⬛⬛⬛⬜⬜⬜⬛⬛⬜⬜⬛⬛⬜⬜⬛⬜⬜⬜⬛⬛ [1] / [0,1,2,6,7,10,11,14,18,19]
// ⬛⬛⬜⬜⬜⬜⬛⬛⬜⬜⬛⬜⬜⬜⬛⬜⬜⬜⬛⬛ [2] / [0,1,6,7,10,14,18,19]
// ⬛⬛⬜⬜⬜⬜⬜⬛⬜⬜⬛⬜⬜⬜⬛⬜⬜⬜⬛⬛ [3] / [0,1,7,10,14,18,19]
// ⬛⬜⬜⬜⬜⬜⬜⬛⬛⬛⬛⬜⬜⬜⬛⬜⬜⬜⬛⬛ [4] / [0,7,8,9,10,14,18,19]
// ⬛⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬛⬛⬜⬜⬛⬛ [5] / [0,8,9,14,15,18,19]
// ⬛⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬛⬛⬛⬛⬛ [6] / [0,8,9,15,16,17,18,19]
// ⬜⬜⬜⬜⬜⬜⬜⬜⬛⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ [7] / [8]
// ⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ [8] / [7,8]
// ⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ [9] / [6,7]
// `
// console.log(ryu)
// setInterval(()=>{console.log("\x1B[1;1H"+'AA')},10)
/**
*  一旦画面全部をリセットする処理が必要そう?なんか文字残る
* control + c でうまくコードが消えないのは、多重console.logのせいだよ
*/
// (_=()=>("(_="+_+")()"))()
console.log((_=()=>{
const w = process.stdout.getWindowSize()
let list2 = [...Array(10)] // これだと横幅分の配列ができてるからちがう
let count = 0;
let str = ''
for (let i = 0 ; i < w-2 ; i ++) {
str += '`'
}
list2.fill(str)
// console.log(list2)
let list3 = list2.map(x=>[...(x)+[]])//これでベースの作成
// console.log(list3)
const color = (x) => `\u001b[36m${x}\u001b[0m`
const charSet = n => m => {console.log(list3[n][m]);list3[n][m]=color('@')}
[0,2,3,4,6,11,14,18].forEach(x=>{charSet(0)(x)});
[0,1,2,6,7,10,11,14,18].forEach(x=>{charSet(1)(x)});
[0,1,6,7,10,14,18].forEach(x=>{charSet(2)(x)});
[0,1,7,10,14,18].forEach(x=>{charSet(3)(x)});
[0,7,8,9,10,14,18].forEach(x=>{charSet(4)(x)});
[0,8,9,14,15,18].forEach(x=>{charSet(5)(x)});
[0,8,9,15,16,17,18].forEach(x=>{charSet(6)(x)});
[8].forEach(x=>{charSet(7)(x)});
[7,8].forEach(x=>{charSet(8)(x)});
[6,7].forEach(x=>{charSet(9)(x)});
// list3.map(y=>{let chara='';y.map(x=>{chara += x});console.log(chara)}) // こんな感じで配列を1つの文字列にしてやる
// console.log('\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n')
setInterval( ()=>{
console.log("\x1B[1;1H" + count)
console.log('\n')
list3.map(
x=>{
// 文字列を1文字ずつずらしていく箇所
const first = x.shift()
let a = '//'
x.forEach(y => {
a += y
})
console.log(a + first)
// console.log(("(_="+_+")()"))
x.push(first)
}
);
count ++
},50)
return ("(_="+_+")()")
})())
console['log']((_=()=>{[w,h]= process .stdout.getWindowSize();
let [c,s,l]=[0,'',[...Array(10)]];for(let i=0;i<w-2;
i++ ){s+= '`'};l.fill(s);let L=l.map(x=>[...(x)+[]]);const
co= x => `\u001b[36m${x}\u001b[0m`;const cS = n => m =>{
L[n ][m] =co('@')}; [0,2,3,4 ,6,11 ,14,18 ].forEach(
x=> {cS( 0)(x)});[0, 1,2, 6, 7, 10,11, 14,18].forEach(
x=> {cS(1)(x)});[0 ,1,6 ,7, 10, 14,18] .forEach(
x=> {cS (2) (x) });[ 0,1, 7,10,14 ,18]. forEach(
x=> {cS (3)(x)});[0, 7,8, 9, 10,14, 18].forEach(
x=> {cS(4) (x)});[0,8, 9,14, 15, 18]. forEach(
x=> {cS(5)(x )});[0,8, 9,15,16,17, 18].forEach(
x=> {cS(6)(x)});[8].forEach (x=>{cS(7)(x)});[7, 8].forEach(x=>
{ cS ( 8 ) ( x ) } ) ; [6,7 ].forEach(x=>{cS(9)(x)});(-~[]+[]);
console.log('\n\n\n\n\n\n' + '\n\n\n\n\n\n\n\n\n\n');setInterval
( ( ) => { console . log( "\x1B[1;1H");L.map(x=>{f=x.shift();
a='//';x.forEach(y=>{a+=y});console.log(a + f);x.push(f)});c++},50);
return("(_="+_+")()")})());(!![]+[])[1]+(-~[]/[]+[])[7]+(!![]+[])[2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment