#include <Socket.h>
#include <barriere.h>
#include <clavier.h>
int main()
{
Socket barriere("172.20.3.73", 5588);
const int codeSecret = 7485;
bool valide = false;
if (!isInFDCL(barriere)) setCommandeSensDescente(barriere);
while (true)
{
clear(barriere);
affiche(barriere, 0, 0, "Bienvenue...");
while (!isBoucleAmont(barriere));
affiche(barriere, "Bonjour", "Code ? ");
do {
valide = codeBon(barriere, codeSecret);
if (!valide) affiche(barriere, "Code incorrect", "Code ? ");
}
while (!valide);
affiche(barriere, "Code bon", "Entrez...");
setCommandeSensMontee(barriere);
while (!(isBoucleAval(barriere) && isBoucleAmont(barriere)));
while (isBoucleAval(barriere));
setCommandeSensDescente(barriere);
}
return 0;
}