pkè non và?
Inviato: 20 apr 2008, 16:45
#include <nanodesktop.h>
#include <stdio.h>
#include <stdlib.h>
int wind;
int ndMain ()
{
int MP;
int exit;
char buffer[maxdim];
char x;
int z;
int i;
ndInitSystem ();
MP=ndLP_CreateWindow (10, 10, 400, 200, "Menu' Principale", COLOR_WHITE, COLOR_BLUE,
COLOR_BLACK, COLOR_WHITE, 0);
ndLP_MaximizeWindow (MP);
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, "1 Definisci fantacalcio *;");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, "2 Cassa ;");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, "3 Scontri ;");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, "4 Crediti ;");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, "5 Esci .");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " ");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, "\t Nota: Le impostazioni segnati con *");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " vanno chiamate solo al primo avvio!");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " ");
ndHAL_Delay ( 5.0 );
do{
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " Scegli in numero dell'opzione da eseguire..");
exit=0;
i=0;
while (!exit)
{
fread (&x, -1, -1, stdin);
if (x!='\n')
{
buffer =x; // Salva il carattere ricevuto nel buffer
i++;
}
else // Hai premuto ENTER. Esci
{
exit=1; // Esce dal ciclo while
ndCloseSystemKeyboard ();
}
}
sscanf(&buffer, "%d", &z);
if (z==1)
{ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " 1 Definisci fantacalcio *.");
ndHAL_Delay ( 2.0 );
wind=ndLP_CreateWindow (50, 50, 400, 200, " Definisci fantacalcio *", COLOR_WHITE, COLOR_BLUE,
COLOR_BLACK, COLOR_WHITE, 0);
ndLP_MaximizeWindow (wind);
def();
}
if (z==2)
{ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " 2 Cassa .");
ndHAL_Delay ( 2.0 );
wind=ndLP_CreateWindow (50, 50, 300, 200, " Cassa", COLOR_WHITE, COLOR_BLUE,
COLOR_BLACK, COLOR_WHITE, 0);
ndLP_MaximizeWindow (wind);
cassa();
}
if(z==3)
{ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " 3 Scontri .");
ndHAL_Delay ( 2.0 );
wind=ndLP_CreateWindow (50, 50, 400, 200, " Scontri", COLOR_WHITE, COLOR_BLUE,
COLOR_BLACK, COLOR_WHITE, 0);
ndLP_MaximizeWindow (wind);
scontri();
}
if(z==4)
{ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " 4 Crediti .");
ndHAL_Delay ( 2.0 );
wind=ndLP_CreateWindow (50, 50, 400, 200, " Crediti", COLOR_WHITE, COLOR_BLUE,
COLOR_BLACK, COLOR_WHITE, 0);
ndLP_MaximizeWindow (wind);
crediti();
}
if(z==5)
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " 5 Esci .");
if (z>5)
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " ERRORE.!");
}while(z!=5);
}
#include <stdio.h>
#include <stdlib.h>
int wind;
int ndMain ()
{
int MP;
int exit;
char buffer[maxdim];
char x;
int z;
int i;
ndInitSystem ();
MP=ndLP_CreateWindow (10, 10, 400, 200, "Menu' Principale", COLOR_WHITE, COLOR_BLUE,
COLOR_BLACK, COLOR_WHITE, 0);
ndLP_MaximizeWindow (MP);
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, "1 Definisci fantacalcio *;");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, "2 Cassa ;");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, "3 Scontri ;");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, "4 Crediti ;");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, "5 Esci .");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " ");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, "\t Nota: Le impostazioni segnati con *");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " vanno chiamate solo al primo avvio!");
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " ");
ndHAL_Delay ( 5.0 );
do{
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " Scegli in numero dell'opzione da eseguire..");
exit=0;
i=0;
while (!exit)
{
fread (&x, -1, -1, stdin);
if (x!='\n')
{
buffer =x; // Salva il carattere ricevuto nel buffer
i++;
}
else // Hai premuto ENTER. Esci
{
exit=1; // Esce dal ciclo while
ndCloseSystemKeyboard ();
}
}
sscanf(&buffer, "%d", &z);
if (z==1)
{ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " 1 Definisci fantacalcio *.");
ndHAL_Delay ( 2.0 );
wind=ndLP_CreateWindow (50, 50, 400, 200, " Definisci fantacalcio *", COLOR_WHITE, COLOR_BLUE,
COLOR_BLACK, COLOR_WHITE, 0);
ndLP_MaximizeWindow (wind);
def();
}
if (z==2)
{ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " 2 Cassa .");
ndHAL_Delay ( 2.0 );
wind=ndLP_CreateWindow (50, 50, 300, 200, " Cassa", COLOR_WHITE, COLOR_BLUE,
COLOR_BLACK, COLOR_WHITE, 0);
ndLP_MaximizeWindow (wind);
cassa();
}
if(z==3)
{ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " 3 Scontri .");
ndHAL_Delay ( 2.0 );
wind=ndLP_CreateWindow (50, 50, 400, 200, " Scontri", COLOR_WHITE, COLOR_BLUE,
COLOR_BLACK, COLOR_WHITE, 0);
ndLP_MaximizeWindow (wind);
scontri();
}
if(z==4)
{ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " 4 Crediti .");
ndHAL_Delay ( 2.0 );
wind=ndLP_CreateWindow (50, 50, 400, 200, " Crediti", COLOR_WHITE, COLOR_BLUE,
COLOR_BLACK, COLOR_WHITE, 0);
ndLP_MaximizeWindow (wind);
crediti();
}
if(z==5)
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " 5 Esci .");
if (z>5)
ndWS_PrintLn (MP , COLOR_WHITE, RENDER, " ERRORE.!");
}while(z!=5);
}