输出"█"在C ncursesw [英] Output "█" with ncursesw in C

查看:121
本文介绍了输出"█"在C ncursesw的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C使俄罗斯方块游戏到嵌入式系统上运行,但我想有使用Block字符,例如█(UNI code 0x2588)做了一个模拟的界面。

I'm making a tetris game in C to run on an embedded system, but I'd like to have a mock up interface made using Block characters such as "█" (UNICODE 0x2588).

提及使用wprintw(),而不是打印()的。

I'm already using ncursesw and have heard mentions of using wprintw() instead of prints().

printw("%i %i %i %i %i %i %i %i %i\n",board[0][i],board[1][i],board[2][i],board[3][i],board[4][i],board[5][i],board[6][i],board[7][i], piece);

应此行是为了输出什么?█?

What should this line be in order to output "█"?

推荐答案

在没有打印功能,只需在 addwstr 功能:

The are no print functions, just the addwstr functions:

addwstr, addnwstr, waddwstr, waddnwstr, mvaddwstr, mvaddnwstr, mvwaddwstr, mvwaddnwstr 
- add a string of wide characters to a curses window and advance cursor

和add_wch功能:

and add_wch functions:

add_wch, wadd_wch, mvadd_wch, mvwadd_wch, echo_wchar, wecho_wchar 
- add a complex character and rendition to a curses window, then advance the cursor

某些字符具有宏例如 WACS_BLOCK 为块。

有关您的code,你将不得不作出的 wchar_t的字符串,然后使用 addwstr

For your code you would have to make the wchar_t string and then use addwstr

这篇关于输出"█"在C ncursesw的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆