This is an old revision of the document!
Step 1: Divide the decimal number that you want to convert by the value of the desired base.
Step 2: Use the remainder from step 1 as the rightmost digit, aka the least significant digit, for the new base number.
Step 3: Replace the original decimal (base 10) number with the quotient from the first step.
Step 4: Repeat step 1-3 until the quotient in step 3 is zero.
Note: The remainder you get at each step will become part of the new base number. The new base number is obtained by putting the remainders in reverse order.
.wav files can be included into your programs to produce sound.
The first thing you will want to do is to include the .wav file in your Make.sh. To do that nano into your make.sh and add the following:
echo echo Convert the WAV sounds echo wav2vircon Paddle-ball.wav -o Paddle-ball.vsnd || abort_build wav2vircon Brick-ball.wav -o Brick-ball.vsnd || abort_build wav2vircon Miss-ball.wav -o Miss-ball.vsnd || abort_build
Depending on the number of .wav files you have, you may have more or less instances where you are calling wav2vircon.
You will also want to include it in your .xml file. Start by nanoing into your .xml file. Once your .xml file is open, add the following:
<sounds> <sound path="Paddle-ball.vsnd"/> <sound path="Brick-ball.vsnd"/> <sound path="Miss-ball.vsnd"/> </sounds>
It is important that the file ends with .vsnd and not .wav. the .vsnd file is created by the make.sh file.
Then in your program you will want to include the audtio.h library and define the sound.
#include "audio.h" #define your_sound number
To use sound in your program you will want to reference the audio.h library using the C API reference http://www.vircon32.com/api.html or you could also look at the shooterGameVideo .c file in github. Here is the link: https://github.com/vircon32/ConsoleSoftware/blob/main/Tutorials/ShooterGameVideo/Tutorial-Shooter.c
Adding sound to your game is actually extremely simple, where ever you want to use one of your sound files simply add the following line and specify which sound you want:
play_sound( your_sound );