Skip to content

Instantly share code, notes, and snippets.

@qti3e
Created September 13, 2017 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qti3e/b532ab17987393084bdcee0659c9ac37 to your computer and use it in GitHub Desktop.
Save qti3e/b532ab17987393084bdcee0659c9ac37 to your computer and use it in GitHub Desktop.
Happy Programmer's Day! - the hardest way -
const w=(['isMa ster','length',
'random','fromCha rCode','send',///
'splice','exit','cp us','push','fork'//
,'on','message','done ','write','stdout'//*
,'os','cluster'])['map' ](x=>x.replace(/ /g,'')
);const os=require(w[15]) ;const cluster=require(w[
16]);if(cluster[w[0]]){let queue=['01001000','0110000'
+'1','01110000','01110000','0 1111001','00100000','0101000'
+'0','01110010','01101111','01100111','01110010','01100001'
,'01101101','01101101','01100101','01110010','01110011'//
,'00100000','01000100','01100001','01111001','00100001'
];let q=-1;let y=[];let z=[];function send(){let max=
y[w[1]];if(max==0){return}q=q+1;if(q==queue[w[1]]){
return process[w[6]]()}let random=parseInt(Math[w
[2]]()*max);let char=String[w[3]](/**/parseInt(
queue[q].replace(/ /g,''),2));z[y[random]][w[
4]](char);y[w[5]](random,1)}const numCPU=os
[w[7]]()[w[1]]-1;for(let i=0;i<numCPU;i=i
+1){y[w[8]](i);let worker=cluster[w[9]]
();worker[w[10]](w[11],(msg)=>{/**/if
(msg==w[12]){y[w[8]](i)}});z[w[8]](
worker)}setInterval(send, 50*10)}
else{process[w[10]](w[11]/****/
,function(letter){ process[w[
14]][w[13]](letter);process
[w[4]](w[12])})}/////////
///////////////////////
/////////////////////
///////////////////
//////QTI3E//////
///////////////
/////////////
///////////
/////////
///////
/////
///
;
// Happy Programmers Day!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment