Tag: 箭头键

(如何读取箭头键)C编程中的作弊码(从键盘输入时)

我在C中制作游戏,当用户输入Konami代码(作弊码)时,程序应打印出正确的答案。 (编辑#3)发现我的程序在输入时没有“读取”箭头键,我该怎么做呢? 请。 请参阅下面的评论 这是我更新的代码(编辑#2)://尝试konami #include #include main() { int c; char cheat[] = {24,24,25,25,27,26,27,26,98,97}; //thanks to Vicky for clarifying this char guess[100]; printf(“Enter guess: “); scanf(“%c”, &guess); //just checking if the cheat array is right, and yes it is. I’ll remove this later for ( c = 0; c < 11; c++ ) { […]