文浩资源

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 25|回复: 0

猜拳游戏

[复制链接]

0

主题

0

帖子

-2万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
-20126
发表于 2019-9-13 23:46:11 | 显示全部楼层 |阅读模式
篇一:猜拳游戏

Orff音乐活动教案

活动反馈:

本节课是一节节奏打击乐活动,幼儿对与节奏和节拍的认识不够,在开展活动的时候对一些乐理知识的渗透要多一点。在玩游戏的环节,幼儿很快上手,但是音乐太快跟不上节奏。还有就是上课常规和乐器使用的常规要继续加强训练。

篇二:猜拳游戏

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace 尼玛的猜拳游戏

{

public enum Mode

{

玩家对战, 人机对战

}

public enum Gesture

{

石头 = 0, 剪刀 = 1, 布 = 2

}

public enum Role

{

前田敦子, 板野友美, 渡边麻友

}

class Game

{

public static int AgainstTheNumber = 0;//对战次数

public static string[] player = new string[2];//游戏中的两个对手

public static int[] victory = { 0, 0 };//每个对手胜利的次数

public static string[] huaQuan = new string[2];//每个对手每次的出拳

public static void StartInterface()//游戏开始界面设置

{

Console.WriteLine("****************************欢 迎 进 入 游 戏 世 界

*****************************");

Console.WriteLine();

Console.WriteLine();

Console.WriteLine();

Console.WriteLine(" *********************** ");

Console.WriteLine(" **猜拳 开始** ");

Console.WriteLine(" *********************** ");

Game.SelectMode();

}

public static void SelectMode()//对战模式选择

{

int choose;

do

{

Console.WriteLine("请选择对战模式:");

Console.WriteLine("1.{0}                2.{1}", Mode.人机对战, Mode.玩家对战);

choose = int.Parse(Console.ReadLine());

switch (choose)

{

case 1:

Console.WriteLine(Mode.人机对战.ToString());

Game.Start(Mode.人机对战.ToString());

break;

case 2:

Console.WriteLine(Mode.玩家对战.ToString());

Game.Start(Mode.玩家对战.ToString());

break;

default:

Console.WriteLine("输入错误,请重新选择");

continue;

}

} while (choose > 2);

}

public static void Start(string mode)//调用角色选择

{

if (mode == Mode.人机对战.ToString())

{

Player.SelectRoles();

}

else

{

Player.SelectRoles(mode);

}

}

public static void Compare()//人机对战划拳结果比较

{

AgainstTheNumber++;

if ((huaQuan[0] == Gesture.布.ToString() && huaQuan[1] == Gesture.剪刀.ToString()) ||

(huaQuan[0] == Gesture.剪刀.ToString() && huaQuan[1] == Gesture.石头.ToString()) ||

(huaQuan[0] == Gesture.石头.ToString() && huaQuan[1] == Gesture.布.ToString()))

{

victory[1]++;

Console.WriteLine("高桥南胜利!请再接再厉!!!");

}

else if ((huaQuan[0] == Gesture.布.ToString() && huaQuan[1] == Gesture.布.ToString()) ||

(huaQuan[0] == Gesture.剪刀.ToString() && huaQuan[1] == Gesture.剪刀.ToString()) ||

(huaQuan[0] == Gesture.石头.ToString() && huaQuan[1] == Gesture.石头.ToString()))

{

Console.WriteLine("打成平手!!不服再战!!!");

}

else

{

victory[0]++;

Console.WriteLine(player[0] + "胜利!恭喜恭喜!!!");

}

}

public static void Compare(string huaQuan1, string huaQua2)//玩家对战划拳结果比较

{

AgainstTheNumber++;

if ((huaQuan[0] == Gesture.布.ToString() && huaQuan[1] == Gesture.剪刀.ToString()) ||

(huaQuan[0] == Gesture.剪刀.ToString() && huaQuan[1] == Gesture.石头.ToString()) ||

(huaQuan[0] == Gesture.石头.ToString() && huaQuan[1] == Gesture.布.ToString()))

{

victory[1]++;

Console.WriteLine(player[1] + "胜利!恭喜恭喜!!!");

}

else if ((huaQuan[0] == Gesture.布.ToString() && huaQuan[1] == Gesture.布.ToString()) ||

(huaQuan[0] == Gesture.剪刀.ToString() && huaQuan[1] == Gesture.剪刀.ToString()) ||

(huaQuan[0] == Gesture.石头.ToString() && huaQuan[1] == Gesture.石头.ToString()))

{

Console.WriteLine("打成平手!!不服再战!!!");

}

else

{

victory[0]++;

Console.WriteLine(player[0] + "胜利!恭喜恭喜!!!");

}

}

public static void Last()//最后总结

{

Console.WriteLine("
************比赛结果****************");

Console.WriteLine("
"+player[0] + "VS" + player[1]);

Console.WriteLine("对战次数:" + AgainstTheNumber);

if (victory[0] > victory[1])

{

Console.WriteLine("{0}胜利,胜利次数是:{1}", player[0], victory[0]);

}

else if (victory[0] < victory[1])

{

Console.WriteLine("{0}胜利,胜利次数是:{1}", player[1], victory[1]);

}

else

{

Console.WriteLine("{0}与{1}打成平手,相约下次再战!!", player[0], player[1]);

}

Console.WriteLine("
———————————————————————————————————————");

Console.WriteLine("———————————————————————————————————————"); Console.WriteLine("****************************游 戏 结 束 ! ! *****************************"); Console.ReadLine();

}

}

class Player

{

public string[] role = new string[3];

public Player()//对角色赋值

{

role[0] = Role.前田敦子.ToString();

role[1] = Role.板野友美.ToString();

role[2] = Role.渡边麻友.ToString();

}

public static void SelectRoles()//人机对战模式选择角色

{

Player players = new Player();

int choose;

do

{

Console.WriteLine("请玩家选择角色(1.{0}        2.{1}        3.{2})", players.role[0], players.role[1], players.role[2]);

choose = int.Parse(Console.ReadLine());

switch (choose)

{

case 1:

Game.player[0] = players.role[0];

Console.WriteLine("
您选择的角色是:" + Game.player[0]);

break;

case 2:

Game.player[0] = players.role[1];

Console.WriteLine("
您选择的角色是:" + Game.player[0]);

break;

case 3:

Game.player[0] = players.role[2];

Console.WriteLine("
您选择的角色是:" + Game.player[0]);

break;

default:

Console.WriteLine("没有这个选项,请重新输入!!");

break;

}

} while (choose > 3);

Game.player[1] = "高桥南";

HuaQuan();

}

public static void SelectRoles(string mode)//玩家对战角色选择

{


《猜拳游戏》出自:百味书屋
链接地址:http://www.850500.com/news/70809.html
转载请保留,谢谢!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

代学代考网络课程远程培训

QQ|手机版|文浩资源 ( 湘ICP备17017632号 )文浩资源

GMT+8, 2024-12-24 01:14 , Processed in 0.223603 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表