wasd
  • 板块灌水区
  • 楼主love_lzx_and_Au
  • 当前回复7
  • 已保存回复7
  • 发布时间2024/7/21 12:30
  • 上次更新2024/7/21 14:29:31
查看原帖
wasd
1260410
love_lzx_and_Au楼主2024/7/21 12:30

求用wasd移动的代码,我的输入要按回车,还有光标``` #include<bits/stdc++.h> #include<windows.h> using namespace std; char zl[20][40]; int n,x,y; char c; int main(){ memset(zl, ' ', sizeof zl); while (1) { zl[y][x] = '&'; for (int i = 0; i < 20; i ++) { for (int j = 0;j < 40; j++){ cout << zl[i][j]; } cout << endl; } memset(zl, ' ', sizeof zl); cin >> c; if (c == 'w')y -= 1; if (c == 's') y += 1; if (c =='a') x -= 1; if (c == 'd') x += 1; system ("cls"); } return 0; }

2024/7/21 12:30
加载中...