求C++小游戏源代码啊~

像坦克啊,贪吃蛇这种小游戏就行,不用搞得太好的,要那种在黑色窗口或白色窗口里玩的小游戏,

第1个回答  2020-02-26
像素射击:int anim abc_fade_in 0x7f010001
int anim abc_fade_out 0x7f010002
int anim abc_grow_fade_in_from_bottom 0x7f010003
int anim abc_popup_enter 0x7f010004
int anim abc_popup_exit 0x7f010005
int anim abc_shrink_fade_out_from_bottom 0x7f010006
int anim abc_slide_in_bottom 0x7f010007
int anim abc_slide_in_top 0x7f010008
int anim abc_slide_out_bottom 0x7f010009
int anim abc_slide_out_top 0x7f01000a
int anim abc_tooltip_enter 0x7f01000b
int anim abc_tooltip_exit 0x7f01000c
int attr actionBarDivider 0x7f040001
int attr actionBarItemBackground 0x7f040002
int attr actionBarPopupTheme 0x7f040003
int attr actionBarSize 0x7f040004
int attr actionBarSplitStyle 0x7f040005
int attr actionBarStyle 0x7f040006
int attr actionBarTabBarStyle 0x7f040007
int attr actionBarTabStyle 0x7f040008
int attr actionBarTabTextStyle 0x7f040009
int attr actionBarTheme 0x7f04000a
int attr actionBarWidgetTheme 0x7f04000b
int attr actionButtonStyle 0x7f04000c
int attr actionDropDownStyle 0x7f04000d
int attr actionLayout 0x7f04000e
int attr actionMenuTextAppearance 0x7f04000f
int attr actionMenuTextColor 0x7f040010
int attr actionModeBackground 0x7f040011
int attr actionModeCloseButtonStyle 0x7f040012
int attr actionModeCloseDrawable 0x7f040013
int attr actionModeCopyDrawable 0x7f040014
int attr actionModeCutDrawable 0x7f040015
int attr actionModeFindDrawable 0x7f040016
int attr actionModePasteDrawable 0x7f040017
int attr actionModePopupWindowStyle 0x7f040018
int attr actionModeSelectAllDrawable 0x7f040019
int attr actionModeShareDrawable 0x7f04001a
int attr actionModeSplitBackground 0x7f04001b
int attr actionModeStyle 0x7f04001c
int attr actionModeWebSearchDrawable 0x7f04001d
int attr actionOverflowButtonStyle 0x7f04001e
int attr actionOverflowMenuStyle 0x7f04001f
int attr actionProviderClass 0x7f040020
int attr actionViewClass 0x7f040021
int attr activityChooserViewStyle 0x7f040022
int attr alertDialogButtonGroupStyle 0x7f040023
int attr alertDialogCenterButtons 0x7f040024
int attr alertDialogStyle 0x7f040025
int attr alertDialogTheme 0x7f040026
int attr allowStacking 0x7f040027
int attr alpha 0x7f040028
int attr alphabeticModifiers 0x7f040029
int attr arrowHeadLength 0x7f04002a
int attr arrowShaftLength 0x7f04002b
int attr autoCompleteTextViewStyle 0x7f04002c
int attr autoSizeMaxTextSize 0x7f04002d
int attr autoSizeMinTextSize 0x7f04002e
int attr autoSizePresetSizes 0x7f04002f
int attr autoSizeStepGranularity 0x7f040030
int attr autoSizeTextType 0x7f040031
int attr background 0x7f040032
int attr backgroundSplit 0x7f040033
int attr backgroundStacked 0x7f040034
int attr backgroundTint 0x7f040035
int attr backgroundTintMode 0x7f040036
int attr barLength 0x7f040037
int attr borderlessButtonStyle 0x7f040038
int attr buttonBarButtonStyle 0x7f040039
int attr buttonBarNegativeButtonStyle 0x7f04003a
int attr buttonBarNeutralButtonStyle 0x7f04003b
int attr buttonBarPositiveButtonStyle 0x7f04003c
int attr buttonBarStyle 0x7f04003d
int attr buttonGravity 0x7f04003e
int attr buttonIconDimen 0x7f04003f
int attr buttonPanelSideLayout 0x7f040040
int attr buttonStyle 0x7f040041
int attr buttonStyleSmall 0x7f040042
int attr buttonTint 0x7f040043
int attr buttonTintMode 0x7f040044
int attr checkboxStyle 0x7f040045
int attr checkedTextViewStyle 0x7f040046
int attr closeIcon 0x7f040047
int attr closeItemLayout 0x7f040048
int attr collapseContentDescription 0x7f040049
int attr collapseIcon 0x7f04004a
int attr color 0x7f04004b
int attr colorAccent 0x7f04004c
int attr colorBackgroundFloating 0x7f04004d
int attr colorButtonNormal 0x7f04004e
int attr colorControlActivated 0x7f04004f
int attr colorControlHighlight 0x7f040050
int attr colorControlNormal 0x7f040051
int attr colorError 0x7f040052
int attr colorPrimary 0x7f040053
int attr colorPrimaryDark 0x7f040054
int attr colorSwitchThumbNormal 0x7f040055
int attr commitIcon 0x7f040056
int attr contentDescription 0x7f040057
int attr contentInsetEnd 0x7f040058
int attr contentInsetEndWithActions 0x7f040059
int attr contentInsetLeft 0x7f04005a
int attr contentInsetRight 0x7f04005b
int attr contentInsetStart 0x7f04005c
int attr contentInsetStartWithNavigation 0x7f04005d
int attr controlBackground 0x7f04005e
int attr coordinatorLayoutStyle 0x7f04005f
int attr customNavigationLayout 0x7f040060
int attr defaultQueryHint 0x7f040061
int attr dialogCornerRadius 0x7f040062
int attr dialogPreferredPadding 0x7f040063
int attr dialogTheme 0x7f040064
int attr displayOptions 0x7f040065
int attr divider 0x7f040066
int attr dividerHorizontal 0x7f040067
int attr dividerPadding 0x7f040068
int attr dividerVertical 0x7f040069
int attr drawableSize 0x7f04006a
int attr drawerArrowStyle 0x7f04006b
int attr dropDownListViewStyle 0x7f04006c
int attr dropdownListPreferredItemHeight 0x7f04006d
int attr editTextBackground 0x7f04006e
int attr editTextColor 0x7f04006f
int attr editTextStyle 0x7f040070
int attr elevation 0x7f040071
int attr expandActivityOverflowButtonDrawable 0x7f040072
int attr firstBaselineToTopHeight 0x7f040073
int attr font 0x7f040074
int attr fontFamily 0x7f040075
int attr fontProviderAuthority 0x7f040076
int attr fontProviderCerts 0x7f040077
int attr fontProviderFetchStrategy 0x7f040078
int attr fontProviderFetchTimeout 0x7f040079
int attr fontProviderPackage 0x7f04007a
int attr fontProviderQuery 0x7f04007b
int attr fontStyle 0x7f04007c
int attr fontVariationSettings 0x7f04007d
int attr fontWeight 0x7f04007e
int attr gapBetweenBars 0x7f04007f
int attr goIcon 0x7f040080
int attr height 0x7f040081
int attr hideOnContentScroll 0x7f040082
int attr homeAsUpIndicator 0x7f040083
int attr homeLayout 0x7f040084
int attr icon 0x7f040085
int attr iconTint 0x7f040086
int attr iconTintMode 0x7f040087
int attr iconifiedByDefault 0x7f040088
int attr imageButtonStyle 0x7f040089
int attr indeterminateProgressStyle 0x7f04008a
int attr initialActivityCount 0x7f04008b
int attr isLightTheme 0x7f04008c
int attr itemPadding 0x7f04008d
int attr keylines 0x7f04008e
int attr lastBaselineToBottomHeight 0x7f04008f
int attr layout 0x7f040090
int attr layout_anchor 0x7f040091
int attr layout_anchorGravity 0x7f040092
int attr layout_behavior 0x7f040093
int attr layout_dodgeInsetEdges 0x7f040094
int attr layout_insetEdge 0x7f040095
int attr layout_keyline 0x7f040096
int attr lineHeight 0x7f040097
int attr listChoiceBackgroundIndicator 0x7f040098
int attr listDividerAlertDialog 0x7f040099
int attr listItemLayout 0x7f04009a
int attr listLayout 0x7f04009b
int attr listMenuViewStyle 0x7f04009c
int attr listPopupWindowStyle 0x7f04009d
int attr listPreferredItemHeight 0x7f04009e
int attr listPreferredItemHeightLarge 0x7f04009f
int attr listPreferredItemHeightSmall 0x7f0400a0
int attr listPreferredItemPaddingLeft 0x7f0400a1
int attr listPreferredItemPaddingRight 0x7f0400a2
int attr logo 0x7f0400a3
int attr logoDescription 0x7f0400a4
int attr maxButtonHeight 0x7f0400a5
int attr measureWithLargestChild 0x7f0400a6
int attr multiChoiceItemLayout 0x7f0400a7
int attr navigationContentDescription 0x7f0400a8
int attr navigationIcon 0x7f0400a9
int attr navigationMode 0x7f0400aa
int attr numericModifiers 0x7f0400ab
int attr overlapAnchor 0x7f0400ac
int attr paddingBottomNoButtons 0x7f0400ad
int attr paddingEnd 0x7f0400ae
int attr paddingStart 0x7f0400af
int attr paddingTopNoTitle 0x7f0400b0
int attr panelBackground 0x7f0400b1
int attr panelMenuListTheme 0x7f0400b2
int attr panelMenuListWidth 0x7f0400b3
int attr popupMenuStyle 0x7f0400b4
int attr popupTheme 0x7f0400b5
int attr popupWindowStyle 0x7f0400b6
int attr preserveIconSpacing 0x7f0400b7
int attr progressBarPadding 0x7f0400b8
int attr progressBarStyle 0x7f0400b9
int attr queryBackground 0x7f0400ba
int attr queryHint 0x7f0400bb
int attr radioButtonStyle 0x7f0400bc
int attr ratingBarStyle 0x7f0400bd
int attr ratingBarStyleIndicator 0x7f0400be
int attr ratingBarStyleSmall 0x7f0400bf
int attr searchHintIcon 0x7f0400c0
int attr searchIcon 0x7f0400c1
int attr searchViewStyle 0x7f0400c2
int attr seekBarStyle 0x7f0400c3
int attr selectableItemBackground 0x7f0400c4
int attr selectableItemBackgroundBorderless 0x7f0400c5
int attr showAsAction 0x7f0400c6
int attr showDividers 0x7f0400c7
int attr showText 0x7f0400c8
int attr showTitle 0x7f0400c9
int attr singleChoiceItemLayout 0x7f0400ca
int attr spinBars 0x7f0400cb
int attr spinnerDropDownItemStyle 0x7f0400cc
int attr spinnerStyle 0x7f0400cd
int attr splitTrack 0x7f0400ce
int attr srcCompat 0x7f0400cf
int attr state_above_anchor 0x7f0400d0
int attr statusBarBackground 0x7f0400d1
int attr subMenuArrow 0x7f0400d2
int attr submitBackground 0x7f0400d3
int attr subtitle 0x7f0400d4
int attr subtitleTextAppearance 0x7f0400d5
int attr subtitleTextColor 0x7f0400d6
int attr subtitleTextStyle 0x7f0400d7
int attr suggestionRowLayout 0x7f0400d8
int attr switchMinWidth 0x7f0400d9
int attr switchPadding 0x7f0400da
int attr switchStyle 0x7f0400db
int attr switchTextAppearance 0x7f0400dc
int attr textAllCaps 0x7f0400dd
int attr textAppearanceLargePopupMenu 0x7f0400de
int attr textAppearanceListItem 0x7f0400df
int attr textAppearanceListItemSecondary 0x7f0400e0
int attr textAppearanceListItemSmall 0x7f0400e1
int attr textAppearancePopupMenuHeader 0x7f0400e2
int attr textAppearanceSearchResultSubtitle 0x7f0400e3
int attr textAppearanceSearchResultTitle 0x7f0400e4
int attr textAppearanceSmallPopupMenu 0x7f0400e5
int attr textColorAlertDialogListItem 0x7f0400e6
int attr textColorSearchUrl 0x7f0400e7
int attr theme 0x7f0400e8
int attr thickness 0x7f0400e9
int attr thumbTextPadding 0x7f0400ea
int attr thumbTint 0x7f0400eb
int attr thumbTintMode 0x7f0400ec
int attr tickMark 0x7f0400ed
int attr tickMarkTint 0x7f0400ee
int attr tickMarkTintMode 0x7f0400ef
int attr tint 0x7f0400f0
int attr tintMode 0x7f0400f1
int attr title 0x7f0400f2
int attr titleMargin 0x7f0400f3
int attr titleMarginBottom 0x7f0400f4
int attr titleMarginEnd 0x7f0400f5
int attr titleMarginStart 0x7f0400f6
int attr titleMarginTop 0x7f0400f7
int attr titleMargins 0x7f0400f8
int attr titleTextAppearance 0x7f0400f9
int attr titleTextColor 0x7f
第2个回答  2020-04-30
我搞个单机版的王者荣耀:

#include <bits/stdc++.h>
using namespace std;
queue<int>q ;
int main()
{
while (1){
q.push;
}
return 0;
}
/*183682529“3"njjshxhhwbsgsubwgyiansjsismwhsysisnshusinwnshshsuwjbshsuwnhshgygsbsbhsujsjjsjsjsisisjsnshsuzusushhshgeyiiajhhisiik,JoksuunIjjjGNWIISHJBWIUSBHH726&#&7)#;%8@9:%89@',a*/
第3个回答  2020-08-26
#include<iostream>
#include<cstdio>
#include<string>
#include<math.h>
#include<iomanip>
#include<ctime>
#include<cstdlib>
#include<windows.h>
using namespace std;
int xx,yy;
void SetColor(int color_num){
int n;
switch (color_num){
case 0:n=0x08; break;//灰色
case 1:n=0x0C; break;//红色
case 2:n=0x0D; break;//紫色
case 3:n=0x0E; break;//黄色
case 4:n=0x0A; break;//绿色
case 5:n=0x0F; break;//白色(用system("color 0F");也可以)
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), n);
}
void kt(string x){
SetColor(3);
Sleep(2000);
cout<<" 正在初始化……"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(50);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # # # # # # # #"<<endl;
Sleep(50);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # #"<<endl;
Sleep(50);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # #"<<endl;
Sleep(50);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
Sleep(50);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # # # # # # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
Sleep(30);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # # # # # # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
Sleep(30);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
Sleep(30);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # #"<<endl;
cout<<" # #"<<endl;
Sleep(30);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(300);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" - # -"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" - - # - -"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" - - - # - - -"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #D #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #De #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #Dev #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #Dev. #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #Dev.C #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #Dev.C+ #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #Dev.C++ #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #Dev.C++H #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #Dev.C++HH #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<"正在初始化……工作室"<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #Dev.C++HH #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # - - - # 工作室#"<<endl;
cout<<" # #"<<endl;
cout<<" #Dev.C++HH #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<" 正在初始化……"<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # 工作室 #"<<endl;
cout<<" #Dev.C++HH #"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(100);
system("cls");
cout<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #Dev.C++HH工作室#"<<endl;
cout<<" # #"<<endl;
cout<<" # # # # # # # # #"<<endl;
Sleep(200);
system("cls");
cout<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #Dev.C++HH工作室#"<<endl;
cout<<" # #"<<endl;
cout<<endl;
Sleep(100);
system("cls");
cout<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<" #Dev.C++HH工作室#"<<endl;
cout<<endl;
cout<<endl;
Sleep(100);
system("cls");
cout<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<" # #"<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
Sleep(100);
system("cls");
cout<<endl;
cout<<" # - - - # - - - #"<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
Sleep(100);
system("cls");
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
Sleep(2000);
system("cls");
SetColor(1);
cout<<"登录:"<<endl;
cout<<"请输入电脑显示验证码"<<endl;
srand((unsigned)time(NULL));
int p=rand()%9999;
int l;
char u1,u2,u3,u4;
string s;
while(1){
if(p<1000){
p=rand()%9999;
}
else{
break;
}
}
cout<<"验证码:"<<p<<endl;
cout<<"请输入验证码:"<<endl;
while(1){
cin>>l;
if(l==p){
cout<<"验证成功,准备开始游戏。"<<endl;
break;
}
else{
cout<<"验证失败,请重新输入:"<<endl;
}
}
Sleep(1000);
system("cls");
SetColor(5);
cout<<" _______________"<<endl;
cout<<"|";
SetColor(1);
cout<<" 石"<<" ";
SetColor(2);
cout<<" 子"<<" ";
SetColor(3);
cout<<" 游"<<" ";
SetColor(4);
cout<<" 戏";
SetColor(5);
cout<<"|"<<endl;
cout<<"|_______________|"<<endl;
SetColor(0);
Sleep(2000);
system("cls");
SetColor(3);
cout<<" ____________________"<<endl;
cout<<"| |"<<endl;
cout<<"|游戏规则: |"<<endl;
cout<<"|玩家输入石子数量和玩|"<<endl;
cout<<"|家最多拿几个石子然后|"<<endl;
cout<<"|一号玩家输入拿的石子|"<<endl;
cout<<"|数量,然后二好玩家输|"<<endl;
cout<<"|入拿的石子数量,就用|"<<endl;
cout<<"|的顺序以此类推,最后|"<<endl;
cout<<"|谁没拿到石子谁就赢。|"<<endl;
cout<<"|____________________|"<<endl;
cout<<"输入或输出下方的O是石子哦。"<<endl;
cout<<"注意审题:"<<endl;
cout<<"是谁没拿到石子谁就赢哦。"<<endl;
cout<<" 请输入>号任意继续……"<<endl;
cin>>x;
system("cls");
}
int main(){
int n,a,b,sum,k,m,p;
string x;
kt(x);
srand((unsigned)time(NULL));
while(1){
SetColor(0);
cout<<" ____________________________"<<endl;
cout<<"|你要机器对战人还是人对战人?|"<<endl;
cout<<"| 1.人机对战 2.双人人对战 |"<<endl;
cout<<"|____________________________|"<<endl;
cout<<"玩家当前玩人机对战"<<xx<<"次"<<endl;
cout<<"玩家当前玩双人对战"<<yy<<"次"<<endl;
cout<<"请输入:";
cin>>p;
system("cls");
system("color 0F");
if(p==2){
yy++;
cout<<"请输入石子数量:"<<endl;
cin>>n;
sum=n;
for(int i=1;i<=n;i++){
cout<<"O";
}
cout<<endl;
cout<<"输入玩家最多拿几个石子:"<<endl;
cin>>k;
for(int i=1;i<=k;i++){
cout<<"O";
}
cout<<endl;
while(1){
cout<<"一号玩家请输入石子数量(1~"<<k<<"个):"<<endl;
cin>>a;
for(int i=1;i<=a;i++){
cout<<"O";
}
cout<<endl;
while(1){
if(a>k){
cout<<"输入错误,请重新输入:"<<endl;
cin>>a;
for(int i=1;i<=a;i++){
cout<<"O";
}
cout<<endl;
}
else if(a<1){
cout<<"输入错误,请重新输入:"<<endl;
cin>>a;
for(int i=1;i<=a;i++){
cout<<"O";
}
cout<<endl;
}
else{
break;
}
}
sum=sum-a;
cout<<"还剩"<<sum<<"枚石子"<<endl;
for(int i=1;i<=sum;i++){
cout<<"O";
}
cout<<endl;
if(sum<=0){
cout<<"二号玩家获胜!!!"<<endl;
cout<<" win!!!"<<endl;
break;
}
else{
cout<<"二号玩家请输入石子数量(1~"<<k<<"个):"<<endl;
cin>>b;
for(int i=1;i<=b;i++){
cout<<"O";
}
cout<<endl;
while(1){
if(b>k){
cout<<"输入错误,请重新输入:"<<endl;
cin>>b;
for(int i=1;i<=b;i++){
cout<<"O";
}
cout<<endl;
}
else if(b<1){
cout<<"输入错误,请重新输入:"<<endl;
cin>>b;
for(int i=1;i<=b;i++){
cout<<"O";
}
cout<<endl;
}
else{
break;
}
}
sum=sum-b;
cout<<"还剩"<<sum<<"枚石子"<<endl;
for(int i=1;i<=sum;i++){
cout<<"O";
}
cout<<endl;
if(sum<=0){
cout<<"一号玩家获胜!!!"<<endl;
cout<<" win!!!"<<endl;
break;
}
}
}
}
else{
xx++;
cout<<"请输入石子数量:"<<endl;
cin>>n;
sum=n;
for(int i=1;i<=n;i++){
cout<<"O";
}
cout<<endl;
cout<<"输入玩家最多拿几个石子:"<<endl;
cin>>k;
for(int i=1;i<=k;i++){
cout<<"O";
}
cout<<endl;
while(1){
cout<<"一号玩家请输入石子数量(1~"<<k<<"个):"<<endl;
cin>>a;
for(int i=1;i<=a;i++){
cout<<"O";
}
cout<<endl;
while(1){
if(a>k){
cout<<"输入错误,请重新输入:"<<endl;
cin>>a;
for(int i=1;i<=a;i++){
cout<<"O";
}
cout<<endl;
}
else if(a<1){
cout<<"输入错误,请重新输入:"<<endl;
cin>>a;
for(int i=1;i<=a;i++){
cout<<"O";
}
cout<<endl;
}
else{
break;
}
}
sum=sum-a;
cout<<"还剩"<<sum<<"枚石子"<<endl;
for(int i=1;i<=sum;i++){
cout<<"O";
}
cout<<endl;
if(sum<=0){
cout<<"二号玩家获胜!!!"<<endl;
cout<<" win!!!"<<endl;
break;
}
else{
cout<<"二号玩家请输入石子数量(1~"<<k<<"个):"<<endl;
b=rand()%k;
cout<<b<<endl;
for(int i=1;i<=b;i++){
cout<<"O";
}
cout<<endl;
while(1){
if(b>k){
cout<<"输入错误,请重新输入:"<<endl;
b=rand()%k;
cout<<b<<endl;
for(int i=1;i<=b;i++){
cout<<"O";
}
cout<<endl;
}
else if(b<1){
cout<<"输入错误,请重新输入:"<<endl;
b=rand()%k;
cout<<b<<endl;
for(int i=1;i<=b;i++){
cout<<"O";
}
cout<<endl;
}
else{
break;
}
}
sum=sum-b;
cout<<"还剩"<<sum<<"枚石子"<<endl;
for(int i=1;i<=sum;i++){
cout<<"O";
}
cout<<endl;
if(sum<=0){
cout<<"一号玩家获胜!!!"<<endl;
cout<<" win!!!"<<endl;
break;
}
}
}
}
SetColor(1);
int r;
cout<<"是否再来一局 1.是 2.否:";
cin>>r;
if(r!=1){
break;
}
else{
system("cls");
}
}
system("cls");
SetColor(3);
cout<<"---游戏结束---"<<endl;
return 0;
}
第4个回答  2018-05-03

我有好多,德州扑克,广东麻将,跳一跳,欢乐大乱斗,星途,找茬,中国象棋,拳皇 等等,有意者联系,我附个截图,直接拼音,看中哪个,直接说,我可以给调试的视频你看。懂价值的来

第5个回答  2020-01-07
非专业就不以代码做答了,有需要可以去爱给网之类的网站上去看看,小游戏代码还比较全的

用c++来编写一个小游戏的源代码,要100-200行就可以了,可以再vc环境下运...
\/\/作者:小斌 include<graphics.h> include<conio.h> include<stdlib.h> \/\/using namespace std;const char LEFT=0x4b;const char RIGHT=0x4d;const char DOWN=0x50;const char UP=0x48;const char ESC=0x1b;const char ENTER=0x0d;const int BX=200;const int BY=170;const int SQ=30...

求一C++小游戏源代码 简单点的?!!谢谢
void Init(void); \/*图形驱动*\/ void Close(void); \/*关闭游戏函数*\/ void DrawK(void); \/*画图函数*\/ void GameOver(void);\/*输出失败函数*\/ void GamePlay(); \/*游戏控制函数 主要程序*\/ void PrScore(void); \/*分数输出函数*\/ DELAY(char ch)\/*调节游戏速度*\/ { if(ch=='3'){...

用C++编写的小游戏源代码
五子棋的代码:include<iostream> include<stdio.h> include<stdlib.h> include using namespace std;const int N=15; \/\/15*15的棋盘 const char ChessBoardflag = ' '; \/\/棋盘标志 const char flag1='o'; \/\/玩家1或电脑的棋子标志 const char flag2='X'; \/\/玩家2的棋子标...

c++编程小游戏代码
以下是贪吃蛇源代码: #include<iostream.h>#include<windows.h>#include#include<stdlib.h>#include<conio.h>#define N 21void gotoxy(int x,int y)\/\/位置函数{COORD pos;pos.X=2*x;pos.Y=y;SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);}void color(int a)\/\/颜色函数{Se...

小游戏的C++代码
\/*一个火柴人游戏,亲自验证,可运行*\/ \/*在编译时添加如下命令:-std=c++11,否则会编译错误*\/ include <cstdio> include <cstdlib> include <Windows.h> include <thread> include <conio.h> using namespace std;const unsigned char CTRL_KEY = 0XE0;const unsigned char LEFT = 0X4B;cons...

求几个不太难的C或者C++的小游戏代码或者推荐两个C或者C++ 的网站
cout<<" p 暂停游戏。";SetPos(52,16);cout<<" e 退出游戏。";SetPos(52,18);cout<<" k 发射子弹。";}\/\/在[a, b)之间产生一个随机整数int random(int a, int b){int c=(rand() % (a-b))+ a;return c;}\/\/在两个坐标包括的矩形框内随机产生一个坐标COORD random(COORD a, COORD b)...

C++做一个小游戏,有源代码的最好,谢谢
C++做一个小游戏,有源代码的最好,谢谢#include <iostream>#include<fstream>#include <ctime>#include <cmath>#include <stdlib.h>#include<stdio.h> //时间 /&#

求助用C或者C++语言实现一个迷宫小游戏代码
using namespace std;int main(){ int i123;cout<<" ."<<endl;cout<<" . ."<<endl;cout<<" . . ."<<endl;cout<<" . ."<<endl;cout<<" ."<<endl;cout<<" T M";for(i123=500;i123<=1000;i123+=100){ Beep(i123,1000);} system("cls");char a[50][50...

能发个C++编程的小游戏的源代码给我吗?比如俄罗斯方块贪食蛇之类的...
GamePlay();\/*玩游戏具体过程*\/ Close();\/*图形结束*\/ } \/*图形驱动*\/ void Init(void){ int gd=DETECT,gm;initgraph(&gd,&gm,"c:\\\\tc");cleardevice();} \/*开始画面,左上角坐标为(50,40),右下角坐标为(610,460)的围墙*\/ void DrawK(void){ \/*setbkcolor(LIGHTGREEN);*\/ ...

跪求用C++语言编写的小游戏的源代码
跪求用C++语言编写的小游戏的源代码 具体要求为:200行左右,语法尽可能简单些,接近大一计算机专业的水平,我只采纳用C++编写的答案,大家来帮帮忙吧!!!... 具体要求为:200行左右,语法尽可能简单些,接近大一计算机专业的水平,我只采纳用C++编写的答案,大家来帮帮忙吧!!! 展开  我来答 ...

相似回答