If COMMAND is given as argument help will show details given COMMAND.EXAMPLES
The following is how to display help for nmap command:
`help nmap`
ALIASES
man
");else if("nmap"===e){_("NAME
nmap -- display the map of network nodes
SYNOPSIS
nmap [ACCESS_CODE ...]
DESCRIPTION
The nmap command displays the map of network nodes based on the ACCESS_CODEs provided as arguments.
There are 4 ACCESS_CODEs that can be found by HACKER in 4 sectors of the network. Each ACCESS_CODE provides different data to the map: Sectors, Connections, Traps and Target.
The nmap command accepts between 0-4 ACCESS_CODEs, case insensitive with optional 0x prefix.
EXAMPLES
The following is how to display map of nodes with [Sectors], [Traps] and [Connections]:
`nmap 0xC16F8 D1234 EF4D0`
");let e=h("0xC16F8 D1234 EF4D0".split(" "));_(c(e)+D()+x(e),"tm pad")}else _("top"===e?"NAME
top -- display the list of top hacker teams' scores.
SYNOPSIS
top [NETWORK_TOP_HACKER_CODE] [TEAM_NAME]
DESCRIPTION
The top command displays the list of the scores of top hackers teams.
If the NETWORK_TOP_HACKER_CODE and optionally the TEAM_NAME is provided new top score record will be added to the list, so you can compare your performance with the best of the best.
EXAMPLES
The following is how to add your noob score to top hackers list:
`top 0xF0020F N00BS`
":"make-me-a-sandwich"===e?"NAME
make-me-a-sandwich -- makes you a sandwich.
SYNOPSIS
make-me-a-sandwich
DESCRIPTION
The make-me-a-sandwich command will make you a sandwich.
If you know how to ask for it.
EXAMPLES
The following is not how to get a sandwich:
`make-me-a-sandwich`
":"cat"===e?"NAME
cat
SYNOPSIS
cat
DESCRIPTION
The cat command.
EXAMPLES
`cat`
":"No help entry for "+e);E("")}function S(){I(),_("Available commands:
- nmap [ACCESS_CODE...] -- display the map of network nodes
- help [COMMAND] -- display detailed help for given command
- top -- display the list of top hacker teams' scores
- make-me-a-sandwich
- cat
"),E("")}function O(){I(),_("COMMAND NOT FOUND: "+K.value),E("")}function y(e){I();let s=h(e);_("MAP OF THE NETWORK:"),_(c(s)+D()+x(s),"tm"),N(e,s.errors),E("")}function A(e){I();let s,a=e[0],n=e.slice(1).join(" ");if(a)try{b(a),a=k(a)}catch(e){s=""+a+" is not a valid NETWORK_TOP_HACKER_CODE. You can get one after successfully hacking the network.",a=null}_(" TOP HACKERS
-------------
TIME LEFT: SWITCHES: TEAM:"+w(a,n).map(s=>(s.code===k(e[0])?"
~ ":"
")+" "+`0${~~(s.time/60)}:${s.time%60<10?"0":""}${s.time%60}`+" "+s.moves+" "+(s.name||"Anonymous")+"
").join("")+"
"),s&&_(s),E("")}function T(e,s){I(),_(e||s.indexOf("--please")>-1||s.indexOf("please")>-1?"Okay.
https://www.xkcd.com/149/":"What? Make it yourself."),E("")}function N(e,s){e.length?s&&s.length&&s.forEach(e=>_("
"+e+" is not a valid ACCESS_CODE.")):_("Network codes not provided.")}function k(e){return e?"0x"+e.replace("0x","").toUpperCase():"unknown"}function M(e,s,a){return"
["+k(a)+"] "+s+""}function x(e){let s="
";return e.colors&&e.colors.length?s+=M("color-springgreen","Sectors",e.colors.code):s+=M("color-red","Sectors"),e.walls?s+=M("color-springgreen","Connections",e.walls.code):s+=M("color-red","Connections"),e.traps?s+=M("color-springgreen","Traps",e.traps.code):s+=M("color-red","Traps"),e.target&&e.target.length?s+=M("color-springgreen","Target coordinates",e.target.code):s+=M("color-red","Target coordinates"),s+"
"}function D(){let e="
Legend:
";return e+="- ◆ - node
",e+="- | - connection
",e+="- ∅ - trap
",(e+="- X - target
")+"
"}function I(){_("
> "+K.value+"")}function _(s,a="",n=F){let t=e.createElement("p");t.setAttribute("class","out "+a),t.innerHTML=s,n.appendChild(t)}function P(){let a=(L=K.value).split(" ").filter(e=>e),n=a.splice(0,1)[0],t="sudo"===n;t&&(n=a.splice(0,1)[0]),-1===a.indexOf("-h")&&-1===a.indexOf("--help")||(a=[n],n="help"),"help"===n||"man"===n?a[0]?g(a[0]):S():"nmap"===n?y(a):"top"===n?A(a):"make-me-a-sandwich"===n?T(t,a):"cat"===n?C():O(),s.scrollTo(0,e.body.scrollHeight)}let W=["#3C5","#3CF","#FC3","#F3C"],R={"0x16C0D6":"bartaz + calanthe","0x2FE011":"Project 2501","0x1D2065":"Oracle/Braniac","0x6A60AA":"The Lone Gunmen","0xE6F0E1":"Acid Burn 'n' Crash Override","0x8A014C":"Wasp & Bob the Dog","0xC6010C":"Johnny Mnemonic and Jones","0xA40139":"Martin Brice with Cosmo","0x92A18F":"fsociety","0x310203":"Neo & Trinity"},F=e.getElementById("terminal"),K=e.getElementById("ti"),L="";e.addEventListener("keydown",e=>{e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(K.focus(),13===e.which?P():38===e.which?(E(L),K.focus()):40===e.which&&E(""))}),e.addEventListener("click",s=>{s.target!==e.documentElement&&s.target!==e.body&&s.target!==e.querySelector(".container")||K.focus()})}(document,window,Math);