Last updated on
One of my friends Greg is really into his video games.
Sometimes it can be a bit of struggle to get him out of the house as he’s glued to the screen!
Here’s the thing though.
When Greg gets a new game, he immediately goes to the settings and puts the difficulty to easy before he starts. He’ll play the game constantly until he completes it and then declare that he’s a master at the game.
“But Greg…” I say “How can you be a master at it if you are just playing it on the easy settings?”
I’m usually responded to with grunts of disdain as Greg starts to unwrap his latest purchase.
The point here is that Greg thinks he’s the bees knees at all the games he completes. But the reality is he would get pummelled if he went up against more experienced players.
It might be called something different if you are using a more exotic browser but I bet it’s there. It’s usually found in the settings menu of your browser (More Tools in Chrome and in the Developer section in Firefox). Or you can try CTRL + SHIFT + I which will open the tools in Chrome and Firefox.
I say you can run small snippets of code because you wouldn’t want to be writing huge programs in the console only for them to disappear when you close the browser!
At a really basic level, the simplest way to do this would be to create a blank HTML document and add a script tag to it:
Notice that you don’t need to have all of the other HTML tags in your page – browsers are clever enough to work out what you are trying to do!
From the above code you can see that using the document.write function allows you to output text directly to the web page.
To install nodejs go the the download page on their site:
Once downloaded, just run through the wizard accepting the default settings.
When it’s completed, open up a command prompt window. The easiest way to do this on Windows is to hold down the SHIFT key and then right click, then choose Open command window here.
This is pretty much the same thing as using the console in your browser as we did before.
- Use document.write – use console.log instead
- Use alert/prompt/confirm boxes
To install Atom Runner in Atom, go to your Settings menu and search for it in the Install tab.
When you have it installed you can run a program by pressing ALT + R on Windows.
I am sure there are other plugins available to but Atom Runner seems to work well for me.