Beispiel #1
0
/* display a message about the winner */
void finalize_round( void )
{
	if ( (char)game->winner == -1 )
		display_text( font, "DRAW" );
	else {
		game->paddles[game->winner]->player->stats.wins++;
		if ( game->winner == cur_player->paddle_id )
			display_text( font, "You have won this round!" );
		else
			display_text( font, "You have lost this round." );
	}
	finalize_level();
	set_state( CS_ROUND_RESULT );
}
Beispiel #2
0
// <- FUNCTIONS -> //
void display(void)
{

    clear_bitmap(buffer);  //clear the buffer

    display_grid();   //displays the blue check box
    display_text();   //displays the text

    display_marks();  //displays the X's and O's





    if(game_win == true)
        draw_sprite(buffer, WIN, mouse_x - ABOVE_MOUSE, mouse_y - ABOVE_MOUSE);
    else if(player == 0)
        //draws the pointer X or O as the mouse moves
        draw_sprite(buffer, O_MARK, mouse_x - ABOVE_MOUSE, mouse_y - ABOVE_MOUSE);
    //masked_blit(CIRCLE, buffer, 0, 0, mouse_x - ABOVE_MOUSE, mouse_y - ABOVE_MOUSE, SCREEN_W, SCREEN_H);
    else if(player == 1)
        //draws the pointer X or O as the mouse moves
        draw_sprite(buffer, X_MARK, mouse_x - ABOVE_MOUSE, mouse_y - ABOVE_MOUSE);

    blit(buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);

}
Beispiel #3
0
t_bunny_response	mainloop(void *_data)
{
  t_data		*data;

  data = (t_data *)_data;
  display_pos(data);
  dtraverse(data->tool, display_button, data);
  start(data);
  set_color_tool(data);
  set_bg(data->sup->pixarray, WHITE);
  dtraverse(data->sup->calc, add_calc, data);
  display_it(data, data->pixback, 78, 2);
  display_it(data, data->sup->pixarray, data->sup->pos.x, data->sup->pos.y);
  display_it(data, data->swatch.pix, WIN_WIDTH - 260, 5);
  display_it(data, data->swatch.pix2, WIN_WIDTH - 260, 112);
  display_it(data, data->pixinfo, 0, WIN_HEIGHT - 20);
  set_bg(data->pixinfocolor, data->tools.color.full);
  display_it(data, data->pixinfocolor, 7, WIN_HEIGHT - 87);
  display_it(data, data->square.pix_square,
	     data->square.init_pos.x, data->square.init_pos.y);
  display_text(data, data->crs.tool, 10, WIN_HEIGHT - 18);
  display_pos(data);
  bunny_display(data->window);
  dtraverse(data->sup->calc, check_button_calc, data);
  draw(data);
  return (GO_ON);
}
Beispiel #4
0
static bool rockblox_help(void)
{
    static char *help_text[] = {
        "Rockblox", "", "Aim", "",
        "Make", "the", "falling", "blocks", "of",
        "different", "shapes", "form", "full", "rows.",
        "Whenever", "a", "row", "is", "completed,",
        "it", "will", "be", "cleared", "away",
        "and", "you", "gain", "points."
    };
    static struct style_text formation[]={
        { 0, TEXT_CENTER|TEXT_UNDERLINE },
        { 2, C_RED },
        LAST_STYLE_ITEM
    };

#ifdef HAVE_LCD_BITMAP
    rb->lcd_setfont(FONT_UI);
#endif
#ifdef HAVE_LCD_COLOR
    rb->lcd_set_background(LCD_BLACK);
    rb->lcd_set_foreground(LCD_WHITE);
#endif
    if (display_text(ARRAYLEN(help_text), help_text, formation, NULL, true))
        return true;
#ifdef HAVE_LCD_BITMAP
    rb->lcd_setfont(FONT_SYSFIXED);
#endif

    return false;
}
Beispiel #5
0
int client_game_init_network( char *opponent_name, int diff )
{
	/* create an empty one level levelset. the server will send
	 * the data into the level everytime we play. */
	game_set = levelset_create_empty( 1, "empty", "empty" );
	
	/* create client game context */
	game = game_create( GT_NETWORK, diff, 100 );
	game_set_current( game );
	game_round = 0; /* will be increased by init_next_round() */
	game_over = 0;
	
	/* a network game communicates every 25 ms by default */
	client_comm_delay = 25;
	no_comm_since = 0;
	
	/* initiate players */
	players_clear();
	player_add( client_name, game->diff->lives, levelset_get_first( game_set ) );
	player_add( opponent_name, game->diff->lives, levelset_get_first( game_set ) );
	cur_player = players_get_first();

	display_text( font, "Receiving level data..." );
	set_state( CS_RECV_LEVEL );
	return 1;
}
Beispiel #6
0
/* display formatted info + score table if multiple players */
static void display_score_table( char *format, ... )
{
	va_list args;
	int i;
	char info[256], buf[32];

	va_start( args, format );
	vsnprintf( info, 64, format, args );
	va_end( args );
	
	if ( player_count > 1 ) {
		strcat( info, "##" );
		for ( i = 0; i < player_count; i++ ) {
			/* add player and score */
			sprintf( buf, "#%12s %10i", " ", 
					players[i].stats.total_score );
			strcpy( buf + 1, players[i].name );
			buf[strlen(players[i].name)+1] = 32;
			strcat( info, buf );
		}
	}

	display_text( font, info );
	stk_display_update( STK_UPDATE_ALL );
}
Beispiel #7
0
static bool sys_do_help(void)
{
#ifdef HAVE_LCD_COLOR
    rb->lcd_set_foreground(LCD_WHITE);
    rb->lcd_set_background(LCD_BLACK);
#endif
    rb->lcd_setfont(FONT_UI);
    char *help_text[] = {
        "XWorld", "",
        "XWorld", "is", "a", "port", "of", "a", "bytecode", "interpreter", "for", "`Another", "World',", "a", "cinematic", "adventure", "game", "by", "Eric", "Chahi.",
        "",
        "",
        "Level", "Codes:", "",
        "Level", "1:", "LDKD", "",
        "Level", "2:", "HTDC", "",
        "Level", "3:", "CLLD", "",
        "Level", "4:", "LBKG", "",
        "Level", "5:", "XDDJ", "",
        "Level", "6:", "FXLC", "",
        "Level", "7:", "KRFK", "",
        "Level", "8:", "KFLB", "",
        "Level", "9:", "DDRX", "",
        "Level", "10:", "BFLX", "",
        "Level", "11:", "BRTD", "",
        "Level", "12:", "TFBB", "",
        "Level", "13:", "TXHF", "",
        "Level", "14:", "CKJL", "",
        "Level", "15:", "LFCK", "",
    };
    struct style_text style[] = {
        { 0, TEXT_CENTER | TEXT_UNDERLINE },
    };

    return display_text(ARRAYLEN(help_text), help_text, style, NULL, true);
}
int repeater()
{
	/*static int i=15;
	i--;
	charge=i;
	charger_status=0;
	remaining_time.hour=1;
	remaining_time.minute=1;
	remaining_time.second=1;
	
	display_text();
	display_gtk();*/
	static int i=0;
	char text[10];
	//while(1)
	{
		int j;
		system("clear");
		//sleep(2);
		printf("\n");
		read_status();
		display_text();
		display_gtk();
		for(j=i;j>=0;j--)
		{
			printf("=");
		}
		i++;
		//sleep(2);
		gtk_main_iteration();
	}
//	sleep(2);
	return 1;
}
Beispiel #9
0
/*
 * Output menu to display port one line at a time, scroll right or left to see more text.
 * Also displays value of the variables to be changed in editiing mode
 */
static void menu_help_testrun_when_idle(void)
{
  while(true)
  {
    display_text();
    joystick_wait_change_update_pos_variables();
  }
}
void opdracht2() {
	DDRD = 0x00;
	TCNT2 = -1;
	TIMSK |= 0x40;
	TCCR2= 0x07; //Turning on counter on button PD7;
	sei();
	init();
	display_text(1,"Count: 0");
}
Beispiel #11
0
uint8_t write_to_TwiFIFO(char msg[])
{
	if(FifoWrite(gTwiFIFO, (unsigned char)strlen(msg)))
	{
		display_text("FIFO ERROR 3");
		return 1;
	}
	
	for(int i = 0; i < strlen(msg); ++i)
	{
		if(FifoWrite(gTwiFIFO, msg[i]))
		{
			display_text("FIFO ERROR 4");
			return 1;
		}
	}
	
	return 0;
}
Beispiel #12
0
int main(void)
{
	//Run the functions as a test.
	init();
	set_cursor(2);
	display_text("Paul4Preside");
    while (1) 
    {
    }
}
int main(void)
{
	DDRD = 0b10000000;
	OCR2 = 250; 
	TIMSK |= BIT(7);
	TCCR2 = 0b00001011;	
	init();
	display_text(1,"Count: 0");
	sei();
    while (1) {}
	return(1);
}
Beispiel #14
0
static void color_link(LINK far *link, int color)
   {
   textcbase = SCREEN_INDENT;
   textrbase = TEXT_START_ROW;

   if (text_type == 1)   /* if 640x200x2 mode */
      display_text(link->r, link->c, color, buffer+link->offset, link->width);
   else
      setattr(link->r, link->c, color, link->width);

   textcbase = 0;
   textrbase = 0;
   }
Beispiel #15
0
/* init next network game round by displaying a message and switching
 * to GET_READY. */
void init_next_round( void )
{
	game_round++;
	set_state( CS_GET_READY );
	init_level( cur_player, cur_player->paddle_id );
	display_text( font,
		"***** Round %i *****###You control the %s paddle in this level!#"
		"To fire a ball keep the mouse button PRESSED.#Don't just click.###"
		"Press any key when you are ready...###(You can pause the game with 'p' any time.)"
		"###NOTE: Due to latency, bonuses on the server are closer than they "
		"appear! I'll try to work on that.", 
		game_round, cur_player->paddle_id==0?"BOTTOM":"TOP" );
}
// send/receive uart - dB-meter
int main( void )
{
	char buffer[16];						// declare string buffer 	

	init_Lcd_4_bit_mode();					// initialize LCD-display
	usart0_init();							// initialize USART0
	usart0_start();
		
	display_text("Hallo");
	set_cursor(0);
	while (1)
	{
		wait(150);							// every 50 ms (busy waiting)
		//PORTB ^= BIT(7);					// toggle bit 7 for testing

		uart0_receiveString( buffer );		// receive string from uart
		
		// write string to LCD display
		display_text(buffer);
		set_cursor(0);
	}
}
Beispiel #17
0
/* Function to test SPI device.
 * This sample used a sparkfun LED matrix connected to SPI1
 * http://www.sparkfun.com/products/760
 */
void test_spi()
{
   uint8_t pic[64];
   /* The led matrix spi can be clock at maximum 125Khz, calc the needed dividers */
   int spi_peripheral_clock = rflpc_clock_get_system_clock() / 8;
   int needed_divider = spi_peripheral_clock / 125000;
   int serial_clock_rate_divider = 1;
   int i = 1;
   int c = 0;

   while (needed_divider / serial_clock_rate_divider > 254)
   {
      serial_clock_rate_divider++;
   }
   needed_divider /= serial_clock_rate_divider;
   printf("Computed clock: %d (%d %d) \r\n", spi_peripheral_clock / (needed_divider * serial_clock_rate_divider), needed_divider, serial_clock_rate_divider);

   rflpc_spi_init(SPI_PORT, RFLPC_SPI_MASTER, RFLPC_CCLK_8, 8, needed_divider, serial_clock_rate_divider, 0);

   
   for (i = 0 ; i < 64 ; ++i)
       pic[i] = 7 << 5;
   led_matrix_display_buffer(pic);
   wait(500000);

   for (i = 0 ; i < 64 ; ++i)
       pic[i] = 7 << 2;
   led_matrix_display_buffer(pic);
   wait(500000);

   for (i = 0 ; i < 64 ; ++i)
       pic[i] = 3;
   led_matrix_display_buffer(pic);
   wait(500000);
   


   c = 0;
   while (1)
   {
       
       for (i = 0 ; i < 64 ; ++i)
	   pic[i] = 0;
       display_text(pic, "Hello World!", c++, 0xFF);
       if (c == 96)
	   c = -8;
	   
       led_matrix_display_buffer(pic);
       wait(200000);
   }
}
Beispiel #18
0
int main(void)
{
	DDRC = 0b11111111;

	char sampleString[] = "This is a sample string";

	lcd_init();
	display_text(sampleString,0);

    while (1) 
    {
		lcd_scrollRight();
		_delay_ms(3000);   
    }
}
static void
encrypt_received (GtkClipboard *board, const gchar *text, SeahorseApplet *sapplet)
{
    gchar *signer = NULL;
    gchar *enctext = NULL;
    gchar **keys = NULL;
    gboolean ret;
    GError *err = NULL;

    /* No text on clipboard */
    if (!text)
        return;
 
    /* Get the recipient list */
    if (cryptui_keyset_get_count (dbus_keyset) == 0)
        cryptui_need_to_get_keys ();
    else
        keys = cryptui_prompt_recipients (dbus_keyset, _("Choose Recipient Keys"), &signer);

    /* User may have cancelled */
    if (keys && *keys) {
        ret = dbus_g_proxy_call (dbus_crypto_proxy, "EncryptText", &err, 
                                G_TYPE_STRV, keys, 
                                G_TYPE_STRING, signer, 
                                G_TYPE_INT, 0,
                                G_TYPE_STRING, text,
                                G_TYPE_INVALID,
                                G_TYPE_STRING, &enctext,
                                G_TYPE_INVALID);
    
        if (ret) {
            /* And finish up */
            gtk_clipboard_set_text (board, enctext, strlen (enctext));
            detect_received (board, enctext, sapplet);
            
            if (seahorse_gconf_get_boolean (DISPLAY_CLIPBOARD_ENC_KEY) == TRUE)
                display_text (_("Encrypted Text"), enctext, FALSE);
        } else {
        	notification_error (_("Encryption Failed"), _("The clipboard could not be encrypted."), 
        	                    sapplet, err);
        	g_clear_error (&err);
        }
        
        g_strfreev(keys);
        g_free (signer);
        g_free (enctext);
    }
}
static void
sign_received (GtkClipboard *board, const gchar *text, SeahorseApplet *sapplet)
{
    gchar *signer = NULL;
    gchar *enctext = NULL;
    gboolean ret;
    GError *err = NULL;
    
    /* No text on clipboard */
    if (!text)
        return;

    if (cryptui_keyset_get_count (dbus_keyset) == 0)
        cryptui_need_to_get_keys (dbus_keyset);
    else
        signer = cryptui_prompt_signer (dbus_keyset, _("Choose Key to Sign with"));
    
    if (signer == NULL)
        return;

    /* Perform the signing */
    ret = dbus_g_proxy_call (dbus_crypto_proxy, "SignText", &err, 
                                G_TYPE_STRING, signer, 
                                G_TYPE_INT, 0,
                                G_TYPE_STRING, text,
                                G_TYPE_INVALID,
                                G_TYPE_STRING, &enctext,
                                G_TYPE_INVALID);
     
     if (ret) {                          
        /* And finish up */
        gtk_clipboard_set_text (board, enctext, strlen (enctext));
        detect_received (board, enctext, sapplet);

        if (seahorse_gconf_get_boolean (DISPLAY_CLIPBOARD_ENC_KEY) == TRUE)
            display_text (_("Signed Text"), enctext, FALSE);
    } else {
        notification_error (_("Signing Failed"), _("The clipboard could not be Signed."), 
                            sapplet, err);
        g_clear_error (&err);
    }
    
    g_free (signer);
    g_free (enctext);
}
Beispiel #21
0
int tty_write(struct file *fp, struct uio *uio) {
    int unit = fp->f_devunit;
    char *buf = uio->uio_iov->iov_base;
	
#if USE_DISPLAY	
    char dbuf[2];    
    dbuf[1] = '\0';
#endif

    if (tty_mutex != PTHREAD_MUTEX_INITIALIZER) {
        pthread_mutexattr_t attr;

        pthread_mutexattr_init(&attr);
        pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);

        pthread_mutex_init(&tty_mutex, &attr);
    }

    pthread_mutex_lock(&tty_mutex);

    while (uio->uio_iov->iov_len) {
        if (*buf == '\n') {
            uart_write(unit, '\r');            
        }
        
        uart_write(unit, *buf);   
      
		#if USE_DISPLAY
        if (redirect_to_display) {
			dbuf[0] = *buf;
			display_text(-1,-1, NULL, -1, -1, dbuf);
		}
		#endif
		
        uio->uio_iov->iov_len--;
        uio->uio_resid--;
        buf++;
    }

    pthread_mutex_unlock(&tty_mutex);
    
    return 0;
}
Beispiel #22
0
void ClipboardHistorySelector::SetupClipboardHistoryTable()
{
    ui.clipboardItemsTable->setRowCount(0);
    ui.clipboardItemsTable->setRowCount(m_ClipboardHistoryItems->count());

    for (int row = 0; row < m_ClipboardHistoryItems->count(); row++)
    {
        QTableWidgetItem *selector = new QTableWidgetItem();
        // Keyboard shortcuts are 1-9 then 0 then a-j
        selector->setText(KEY_SELECTORS.at(row));
        selector->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
        ui.clipboardItemsTable->setItem(row, 0, selector);

        QString text = m_ClipboardHistoryItems->at(row); 
        QString display_text(text);
        
        // Replace certain non-printable characters with spaces (to avoid
        // drawing boxes when using fonts that don't have glyphs for such
        // characters)
        QChar *uc = display_text.data();
        for (int i = 0; i < (int)text.length(); ++i) {
            if ((uc[i] < 0x20 && uc[i] != 0x09)
                || uc[i] == QChar::LineSeparator
                || uc[i] == QChar::ParagraphSeparator
                || uc[i] == QChar::ObjectReplacementCharacter)
                uc[i] = QChar(0x0020);
        }
        // Also replace any tab characters with an arrow glyph
        display_text = display_text.replace(QChar('\t'), QChar(0x2192));

        QTableWidgetItem *clip = new QTableWidgetItem();
        clip->setText(display_text);
        clip->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
        clip->setData(Qt::UserRole, QVariant(text));
        clip->setToolTip(text);
        ui.clipboardItemsTable->setItem(row, 1, clip);
    }
    ui.clipboardItemsTable->setColumnWidth(0, 20);
    ui.clipboardItemsTable->resizeRowsToContents();
    if ( m_ClipboardHistoryItems->count() > 0 )
        ui.clipboardItemsTable->selectRow(0);
}
Beispiel #23
0
int main(void)
{
    
	DDRC = 0xFF;
	DDRD  = 0b00000000 ;
	TCCR2 = 0b00000111;
	TIMSK |= 0b00000010;
	char buf[3];
	int cijfer;
	int ind;
	
	sei();

	while (1)
	{
	if (cijfer != TCNT2){
	cijfer = TCNT2;
	if(cijfer < 10){
	ind = 0;
	}
	else{
	if(cijfer >= 10 && cijfer < 100){
	ind = 1;
	}
	else{
	ind = 2;
	}
	}
	itoa(cijfer, buf, 10);
	char* s = buf;
	clear();
	init();
	//setcursor(5);
	display_text(s, ind);
	_delay_ms(100);
	}
	else{

	}
	}
	return 1;
}
Beispiel #24
0
/* Pause/unpause a local/network game. */
static void client_set_pause( int pause )
{
  if (game_set==0) return; /* test level */
  if (pause&&client_state==CS_PLAY)
    {
      /* in local game simply darken the screen, in
       * network game enter the pausechatroom */
      if ( game->game_type == GT_LOCAL ) {
	set_state(CS_PAUSE);
	display_text( font, "Pause" );
      }
      else {
	open_pause_chat( "You have paused the game." );
	comm_send_short( MSG_PAUSE );
      }
    }
  else if (!pause&&client_state==CS_PAUSE)
    {
      /* unpause (local game only)*/
      if ( game->game_type == GT_LOCAL )
	set_state(CS_PLAY);
    }
}
Beispiel #25
0
/* display the final statistics. the first player is always this client
 * and the second is the remote. */
void display_final_stats( void )
{
	int win;

	/* won this match? */
	if ( game_stats[0][0] > game_stats[1][0] )
		win = 1;
	else
	if ( game_stats[0][0] == game_stats[1][0] )
		win = -1;
	else
		win = 0;
	
	/* build stats string */
	display_text( font, 
			"             Result: %s              ##" \
			"                  %12s %12s##" \
			"Wins:             %12i %12i#" \
			"Losses:           %12i %12i#" \
			"Draws:            %12i %12i#" \
			"#" \
			"Total Score:      %12i %12i#" \
			"#" \
			"Balls Kept:       %11i%% %11i%%#" \
			"Bricks Cleared:   %11i%% %11i%%#" \
			"Extras Collected: %11i%% %11i%%##" \
                        "(Press SPACE to continue)",
			win==1?"VICTORY":win==0?" DEFEAT":"   DRAW",
			players[0].name, players[1].name,
			game_stats[0][0], game_stats[1][0],
			game_stats[0][1], game_stats[1][1],
			game_stats[0][2], game_stats[1][2],
			game_stats[0][3], game_stats[1][3],
			game_stats[0][4], game_stats[1][4],
			game_stats[0][5], game_stats[1][5],
			game_stats[0][6], game_stats[1][6] );
}
Beispiel #26
0
uint8_t decode_message_TwiFIFO()
{
	
	uint8_t *len = 0;
	uint8_t *character = 0;
	
	if(FifoRead(gTwiFIFO, len))
	{
		//No new messages
		return 1; // error
	}
	
	int length = *len; // I don't know why I can't use *len directly... but it took me 4h to figure out that you can't do it....
	
	//NOTE: there has to be a better way of doing this...
	int ifzero = 0;
	if(length == 0) ifzero = 1;
	char msg[length-1+ifzero];

	for(int i = 0; i < length; ++i)
	{
		if(FifoRead(gTwiFIFO, character))
		{
			display_text("FIFO ERROR 2!");
			return 1; // error
		}

		msg[i] = *character;
	}
	
	
	// TODO: send to relevant party... the display for now
	
	display_text_fixed_length(msg, length);
	
	return 0;
}
Beispiel #27
0
static void display_bonus_level_score()
{
    double avgRatio = 0;
    char info[256]; 
    info[0] = 0;
    if (local_game->blNumCompletedRuns==0) 
        avgRatio = 0;
    else
        avgRatio = local_game->blRatioSum/local_game->blNumCompletedRuns;
    switch (local_game->level_type)
    {
        case LT_JUMPING_JACK:
            display_text( font, "%s, you hit %d Jumping Jacks!##Your average ratio: %5d%%#        Your score: %6d",
                      cur_player->name,local_game->blNumCompletedRuns,
                      (int)(100.0*avgRatio),local_game->totalBonusLevelScore);
            break;
        case LT_OUTBREAK:
            display_text( font, "%s, you stopped %d Outbreaks!##Your average ratio: %5d%%#        Your score: %6d",
                      cur_player->name,local_game->blNumCompletedRuns,
                      (int)(100.0*avgRatio),local_game->totalBonusLevelScore);
            break;
        case LT_BARRIER:
            display_text( font, "%s, you broke through %d Barriers!##Your average ratio: %5d%%#        Your score: %6d",
                      cur_player->name,local_game->blNumCompletedRuns,
                      (int)(100.0*avgRatio),local_game->totalBonusLevelScore);
            break;
        case LT_SITTING_DUCKS:
            display_text( font, "%s, you shot %d Sitting Ducks!##Your score: %6d",
                      cur_player->name,local_game->blNumCompletedRuns,
                      local_game->totalBonusLevelScore);
            break;
        case LT_HUNTER:
            display_text( font, "%s, you hunted down %d bricks!##Your average ratio: %5d%%#        Your score: %6d",
                      cur_player->name,local_game->blNumCompletedRuns,
                      (int)(100.0*avgRatio),local_game->totalBonusLevelScore);
            break;
		case LT_DEFENDER:
            display_text( font, "%s, you stopped %d waves#killing a total of %d invaders!##Your average ratio: %5d%%#        Your score: %6d",
                      cur_player->name,local_game->blNumCompletedRuns,local_game->blTotalNumKilledInvaders,
                      (int)(100.0*avgRatio),local_game->totalBonusLevelScore);
			break;
    }
    stk_display_update( STK_UPDATE_ALL );
}
Beispiel #28
0
static bool clix_help(void)
{
    static char *help_text[] = {
        "Clix", "", "Aim", "",
        "Remove", "all", "blocks", "from", "the", "board", "to", "achieve",
        "the", "next", "level.", "You", "can", "only", "remove", "blocks,",
        "if", "at", "least", "two", "blocks", "with", "the", "same", "color",
        "have", "a", "direct", "connection.", "The", "more", "blocks", "you",
        "remove", "per", "turn,", "the", "more", "points", "you", "get."
    };
    static struct style_text formation[]={
        { 0, TEXT_CENTER|TEXT_UNDERLINE },
        { 2, C_RED },
        LAST_STYLE_ITEM
    };

    rb->lcd_setfont(FONT_UI);
    rb->lcd_set_foreground(LCD_WHITE);
    if (display_text(ARRAYLEN(help_text), help_text, formation, NULL, true))
        return true;
    rb->lcd_setfont(FONT_SYSFIXED);

    return false;
}
void
BalanceSheetReport::display_body()
{
    // Assume m_balance_map is up-to-date. Use its contents to display
    // the report contents.
    
    // TODO MEDIUM PRIORITY Can we just ignore equity Accounts here?

    increment_row();

    display_text(wxString("Opening balance "), 2, wxALIGN_RIGHT);
    display_text(wxString("  Movement "), 3, wxALIGN_RIGHT);
    display_text(wxString("  Closing balance "), 4, wxALIGN_RIGHT);

    increment_row();
    
    list<wxString> asset_names;
    list<wxString> equity_names;
    list<wxString> liability_names;

    for (auto const& elem: m_balance_map)
    {
        Handle<Account> const account(database_connection(), elem.first);
        wxString const name = account->name();
        switch (account->account_type())
        {
        case AccountType::asset:
            asset_names.push_back(name);
            break;
        case AccountType::liability:
            liability_names.push_back(name);
            break;
        case AccountType::equity:
            equity_names.push_back(name);
            break;
        default:
            JEWEL_HARD_ASSERT (false);
        }
    }
    asset_names.sort();
    equity_names.sort();
    liability_names.sort();

    vector<wxString> section_titles;
    section_titles.push_back(wxString("ASSETS"));

    // TODO LOW PRIORITY Assuming no Equity Account. Do an assertion
    // to this effect.
    section_titles.push_back(wxString("LIABILITIES"));
    vector<AccountType> section_account_types;
    section_account_types.push_back(AccountType::asset);
    section_account_types.push_back(AccountType::liability);
    JEWEL_ASSERT (section_titles.size() == section_account_types.size());

    Decimal const zero
    (   0,
        database_connection().default_commodity()->precision()
    );
    Decimal net_assets_opening = zero;
    Decimal net_assets_closing = zero;
    for (vector<wxString>::size_type i = 0 ; i != section_titles.size(); ++i)
    {
        // TODO LOW PRIORITY This relies on every Account having the same
        // Commodity. Do an assertion to this effect.
        Decimal opening_balance_total = zero;
        Decimal closing_balance_total = zero;
        list<wxString>* names = 0;
        switch(section_account_types.at(i))
        {
        case AccountType::asset:
            names = &asset_names;
            break;
        case AccountType::liability:
            names = &liability_names;
            break;
        default:
            JEWEL_HARD_ASSERT (false);
        }
        display_text(section_titles.at(i), 1);
        
        increment_row();

        JEWEL_ASSERT (names);
        for (wxString const& name: *names)
        {
            Handle<Account> const account
            (   database_connection(),
                Account::id_for_name(database_connection(), name)
            );
            BalanceMap::const_iterator const jt =
                m_balance_map.find(account->id());
            JEWEL_ASSERT (jt != m_balance_map.end());
            BalanceDatum const& datum = jt->second;
            Decimal const& ob = datum.opening_balance;
            Decimal const& cb = datum.closing_balance;

            // Only show Accounts with non-zero balances
            if ((ob != zero) || (cb != zero))
            {
                display_text(name, 1);
                display_decimal(ob, 2);
                display_decimal(cb - ob, 3);
                display_decimal(cb, 4);
                opening_balance_total += ob;
                closing_balance_total += cb;

                increment_row();
            }
        }
        display_text(wxString("  Total"), 1);
        display_decimal(opening_balance_total, 2);
        display_decimal(closing_balance_total - opening_balance_total, 3);
        display_decimal(closing_balance_total, 4);
        net_assets_opening += opening_balance_total;
        net_assets_closing += closing_balance_total;

        increment_row();
        increment_row();
    }

    display_text(wxString("  Net assets"), 1);
    display_decimal(net_assets_opening, 2);
    display_decimal(net_assets_closing - net_assets_opening, 3);
    display_decimal(net_assets_closing, 4);

    increment_row();

    return;
}
void opdracht1() {
	init();
	display_text(1,"feest");
	display_text(2," boef12345678");
	set_cursor(18);
}