HelloWord version 2

De ZbahWiki.

Code

// -*- coding: utf-8 -*-
// Exemple NXC: HelloWorldV2
 
#include "NXCDefs.h" 
 
void affiche ( int i , string phrase ) {
    ResetScreen ();
    int ligne = i % 5  ;
    TextOut ( 0 , 56-(ligne*8) , phrase );
}
 
task main()
{
    int i , ligne ;
    for ( i=0 ; i<20 ; i++ ) {
        // Ecrit le texte sur l'écran LCD du NXT
        affiche ( i , "HelloWorld !" );
        // Attends 0.2 secondes
        Wait ( 200 );
    }
}

Fonctions utilisées

Outils personnels