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
| const temp1 = text.split(/\r?\n/); //I copy-paste my puzzle into the 'text' variable instead of opening it as a file, but works the same | |
| let sum=0; //Variable to store the first answer | |
| let directory= {'/':{size:0}}; //Where I store all directories | |
| let cwd=['/']; //Current working directory | |
| temp1.forEach( x=> { | |
| x=x.split(' '); //I seperate each line into a list, eg: ['$', 'cd', 'sdfdsf'] | |
| //Commands | |
| if(x[0]==='$') { | |
| if(x[1]==='cd') { | |
| //Go back one level |
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
| /** | |
| @func | |
| log how long it takes to run a block of code | |
| - for a supplied number of times | |
| @warning | |
| the supplied func runs in a loop | |
| - so first make sure there are no log statements in the func | |
| - either comment them out, or replace them with lMock... | |
| - const l = s => undefined; //lMock |
Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...
What this guide covers:
