我在绘制以下方块时遇到麻烦:
* # # # # #
* * # # # #
* * * # # #
* * * * # #
* * * * * #
* * * * * *
Run Code Online (Sandbox Code Playgroud)
这是我写的方法,但它不能正常工作:
public void Draw(int width){
char asterisk = '*';
char hash = '#';
int counter = 0;
for (int h = 0; h < 6; h++) { //height?
for (int w = 0; w < width; w++) {
if (h == counter)
Console.Write …Run Code Online (Sandbox Code Playgroud)