Now that we have our Eutelsat H and P I want to write some more functions for it.
But first I want to go over how to open the door.
You're needed.
OS is Konsole using Eclipse.
So so so far we've only used the built in console but there are certain features that we'd like to use
that this console can't do.
And your net native OS is console can.
So how to run your program through the native console is what I want to offer.
So for Windows users only I want to start with you here is the external tools configuration and you
want to hit external tools configurations like this.
OK.
So that in these new configuration are for it probably start like this.
I was doing some testing for.
So you probably don't have any.
So does it right and then new.
And for your configuration you want to give it a name and you can call mine command prompt like this
and in your locations you want to type this see on slash windows slash system
to slash command C indeed c or wherever this is on your system and for your working directory type dollar
sign.
Open curly brace workspace
underscore L and then slash.
Project name for this one hangman and this and close race and for arguments you want to type slash capital
C and then open quotes start
and then space dollar sign looping clearly raise system
score pass Colon's see indeed you see close Kerley race.
Slash capital K space dot slash debug slash your project names.
In this case saying mend it easy and enclose the quotes OK and hit apply.
And then after that don't it run yet.
Hit close.
I'm not going to apply because I'm on a Mac so this doesn't this doesn't actually this won't work for
me.
I'm close but you should apply and then close and then on your project.
Right click and hit properties.
And in settings under miscellaneous.
You should try this dash.
Static dash libs see space Dasch static dash lib STDs C++ and hit apply again in emacs.
I don't have to do this but the reason why we're doing this is if you ever tried to run your program
directly through your file system then noticed that it might have given you an error and that error
says it can't find some library or something.
OK so this will actually fix that.
So hit apply and so it hit ok again.
I don't need to do this and cancel and then to run it.
You should hit this external tools button.
And that should open your new command prompt configuration.
And you should see the actual game now in your command console so for Mac users what we need to do is
say run and say run configurations and then here in C++ the Asians you should type slash user slash
been slash open.
And then arguments tied to ASH a slash applications slash Tillie's
slash terminal dot
space dash or Dortch slash debug slash hangman and hit apply
and in common you want to and tick this outkicked con. take that apply and you can try to run so noticed
they opened the console or this terminal and in Mac land and it's running our game can of say hello
rune is the secret phrase it's running the game.
OK so you may ask why we did this at all and that is because I want to be able to clear the screen.
So you do that we're going to go back to our tails
to the H and add function.
So it's called voyde clear screen this name.
Implement it.
It's implemented down here.
FOID clear screen
that.
And again there's going to be two different things for the two different two major platforms for Windows
when you type system in quotes.
CLX
like it says it's for Windows.
And for Mac people like myself type system and then clear.
So now that we have that this will actually clear the screen.
This didn't work.
This doesn't work in the native eclipse console but this will work on your native console.
And so we go back to Hank and to draw board in I'm I'm really I'm actually go to there I'm just sitting
command and maybe the Windows key if you're on Windows then click and was going to see a clear screen
drop toward
And we're going to run it
there.
So hello everyone.
And I noticed that it actually cleared the screens so there's no extra output that was there before.
OK.
So which is nice.
That's the whole point of doing this for you may notice if you're on a Mac if you scroll up didn't actually
clear the screen all it just put enough is enough spaces that it doesn't show.
OK.
On Windows I think it'll actually clear the screen properly and that's it for your screen.
So this is actually kind of nice.
Makes it a bit more aesthetically pleasing.
There's one other function I want to add to you.
And we'll be using it later but it's going to hide it now and it's going to comb for each or he press
and so do essentially is pause the pause the game essentially or pause the
kind of block on input and you have to type a type of character to kind of continue.
And when you're using it in this game.
But we will be using it in the next game we do.
So I can implement this now.
In or for the press and again there's going to be two different implementations so for Windows users
it's going to be system pause this is Windows only.
So you got the easy on the Mac users we have that bit more tricky.
So you say System read dash and one space dash -- dash P and then backslash quote again.
Press any key to you.
Slash quote and then semi-colon echo
so it's a bit more tricky for us Mac users but hopefully you just kind of copy this line and don't really
think about it too much.
I'm not going to use it in hangman but I will be using it in the Battleship game.
OK so if you want to see what this does.
Feel free to put this somewhere in hangman and see what it does.
So that's it for hangman so I'll see you in the next section.