Board logo

標題: 有關一條c的題目 [打印本頁]

作者: ihmcjacky    時間: 2008-11-25 17:00     標題: 有關一條c的題目

條題目係咁既:
1.A 2D array of char called image is defined in the program. This 2D array is used as the canvas for drawing text characters.

    * Each element in the 2D array is a pixel.
    * The value of 0 represents black and the value of 1 represents white.
    * The size of the image is specified in the #define macro SIZE. Therefore whenever you refer to the size of the image, you should use SIZE.

Add a menu item [L] that allows users to plot a point on the canvas.  The program then asks the user to enter the position in x, y coordinate.  The program then sets the appropriate 2D array element to 1.  The program should check whether the entered coordinate is within the canvas (i.e. using the macro SIZE).

Image Drawer
[L] Plot
[Q] Quit
L
Enter the position [x][y]: 2 2
[Drawer] Plot Successful
...


2. Add another menu item [P] that prints the canvas on the screen. The character 『*' is printed for a white pixel, and the character 『.' is printed for a black pixel.


第一條已經做左,但第2條我唔係好知佢想點?佢係想我用0呢個character黎砌呢個『*'符號出黎定點?
我係咪要寫到有啲咁既野show出黎?
0 0      
0
0

PS:大家唔好講埋答案,我想自己諗下,我只係想知題目想問什麼?
應該是說我應該畀咩output佢先啱

[ 本帖最後由 ihmcjacky 於 2008-11-25 17:03 編輯 ]
作者: GPoker    時間: 2008-11-25 17:09

佢係想你用佢俾你既指定符號畫圖
**...**
*.....*
**...**
作者: ihmcjacky    時間: 2008-11-25 17:17     標題: 回覆 2# 的帖子

thx first~
你的意思是說要用'*'來畫'『'出黎?
咁black and white是否反轉來print
的意思?
e.g.如果print white,咁啲*就print'『'出黎
如果係black,就print除'『'外的其他部分?





歡迎光臨 電腦領域 HKEPC Hardware (https://www.hkepc.com/forum/) Powered by Discuz! 7.2