player

Werewolf

╄→гoц情女王★ 提交于 2020-02-09 01:28:02
Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game, player #1 said: "Player #2 is a werewolf."; player #2 said: "Player #3 is a human."; player #3 said: "Player #4 is a werewolf."; player #4 said: "Player #5 is a human."; and player #5 said: "Player #4 is a human.". Given that there were 2 werewolves among them, at least one but not all the werewolves were lying, and there were exactly 2 liars. Can you point out the werewolves? Now you are asked to solve a harder vertion of this problem: given that there

Java 实现简单的人机猜拳游戏

大城市里の小女人 提交于 2020-02-08 18:05:57
1 import java.util.Scanner; 2 3 import java.util.Random; 4 5 public class TestGuess{ 6 7 public static void main(String[] args){ 8 9 Scanner yc = new Scanner(System.in); 10 Random cy = new Random(); 11 12 System.out.println("=============================================="); 13 System.out.println("====================人机猜拳=================="); 14 System.out.println("=============================================="); 15 System.out.println("====数字1 = 剪刀 数字2 = 石头 数字3 = 布===="); 16 System.out.println("=============================================="); 17 18 int computerCount = 0; //电脑的获胜次数 19 int

给Linux安装Flash Player

南笙酒味 提交于 2020-02-06 10:39:23
噫吁嚱,大一期末将至,吾等尚未预习高等数学之属,今开哔哩哔哩于欧朋浏览器,欲观之高数叔视频,却遇未安装Flash Player之示于屏中,历千辛万苦,今分给众教程. 1.在Flash Player官网下载适用于当前系统的Flash Player,一般会根据浏览器提供信息自动识别,我这里是Deepin系统下的Opera浏览器,因此下载的是 .tar.gz 的压缩包 https://get.adobe.com/cn/flashplayer/ 2.下载完成后,复制文件所在路径 (以上两步当然可以用wget 呃呃呃) 3.打开终端 终端输入:cd /usr/lib 回车 接着输入:sudo mkdir adobe-flashplugin 回车输入用户密码继续回车(创建插件的目录) 然后输入:cd adobe-flashplugin 回车(进入插件目录) 下来是把刚才下载的压缩包解压到当前文件夹了 在终端输入:sudo tar -zxvf 文件路径 到这里安装flash player for linux 就完成了! 下来就可以安心的用他来看b站学(wan)习(shua)了 Tip:如果用Chrome的话可以直接用h5播放器观看,可是我不知道opera下怎样调用h5播放器lol,难过。过两天有空再捣鼓吧555 来源: CSDN 作者: sam_smith. 链接: https://blog

LeetCode All in One 题目讲解汇总(持续更新中...)

两盒软妹~` 提交于 2020-02-06 07:31:46
In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach or exceed 100 wins. What if we change the game so that players cannot re-use integers? For example, two players might take turns drawing from a common pool of numbers of 1..15 without replacement until they reach a total >= 100. Given an integer maxChoosableInteger and another integer desiredTotal , determine if the first player to move can force a win, assuming both players play optimally. You can always assume that maxChoosableInteger will not

《java第二次实验》

自作多情 提交于 2020-02-06 05:28:33
(一)学习总结 1.什么是构造方法?什么是构造方法的重载?下面的程序是否可以通过编译?为什么? public class Test { public static void main(String args[]) { Foo obj = new Foo(); } } class Foo{ int value; public Foo(int intValue){ value = intValue; } } 构造方法是一种特殊的方法,它是一个与类同名且没有返回值类型的方法。对象的创建就是通过构造方法来完成,其功能主要是完成对象的初始化。当类实例化一个对象时会自动调用构造方法。构造方法和其他方法一样也可以重载。 (1)在Java中,允许在一个类中定义多个构造方法。 (2)在创建对象时,系统会自动根据所调用的构造方法中包含的参数类型,个数,选择匹配的构造方法创建对象。 (3)构造方法的注意事项 (4)如果在类中没有明确定义构造方法,系统会自动调用默认的构造方法。 (5)如果指定了构造方法,则不调用默认的构造方法。 (6)如果已经指定了有参的构造方法,而又要调用无参的构造方法,则要在类中追加无参构造。 下面的程序不能通过编译,new Foo()错误,应创建构造函数Foo()。 2.运行下列程序,结果是什么?分析原因,应如何修改 public class Test { public

jQuery实现高仿QQ音乐

血红的双手。 提交于 2020-02-06 03:33:29
几个实现的效果看视频吧: 动图很是不清楚 代码: html <!DOCTYPE html> < html lang = " en " > < head > < meta charset = " UTF-8 " > < title > music </ title > < link href = " ../jquery.mCustomScrollbar.css " rel = " stylesheet " > < link href = " ../../../img/sup.ico " rel = " icon " > < link href = " ../css/style.css " rel = " stylesheet " > < script src = " ../../../jquery-3.4.1.min.js " > </ script > < script src = " ../jquery.mCustomScrollbar.concat.min.js " > </ script > < script src = " ../js/player.js " > </ script > < script src = " ../js/index.js " > </ script > </ head > < body > < div class = " container "

python 井字棋(Tic Tac Toe)

浪尽此生 提交于 2020-02-05 07:19:40
说明 用python实现了井字棋,整个框架是本人自己构思的,自认为比较满意。另外,90%+的代码也是本人逐字逐句敲的。 minimax算法还没完全理解,所以参考了 这里 的代码,并作了修改。 特点 可以选择人人、人机、机人、机机四种对战模式之一 电脑玩家的AI使用了minimax算法,带apha-beta剪枝 电脑玩家在思考时,时时刻刻都有一个 “假想敌” 。以便使得minimax算法运转起来 代码 作者:hhh5460 时间:2017年6月26日 # 棋盘 class Board(object): def __init__(self): #self._board = '-'*9 # 坑!! self._board = ['-' for _ in range(9)] self._history = [] # 棋谱 # 按指定动作,放入棋子 def _move(self, action, take): if self._board[action] == '-': self._board[action] = take self._history.append((action, take)) # 加入棋谱 # 撤销动作,拿走棋子 def _unmove(self, action): self._board[action] = '-' self._history.pop() # 棋盘快照

LeetCode All in One 题目讲解汇总(持续更新中...)

主宰稳场 提交于 2020-02-05 07:17:04
Design a Tic-tac-toe game that is played between two players on a n x n grid. You may assume the following rules: A move is guaranteed to be valid and is placed on an empty block. Once a winning condition is reached, no more moves is allowed. A player who succeeds in placing n of their marks in a horizontal, vertical, or diagonal row wins the game. Example: Given n = 3, assume that player 1 is "X" and player 2 is "O" in the board. TicTacToe toe = new TicTacToe(3); toe.move(0, 0, 1); -> Returns 0 (no one wins) |X| | | | | | | // Player 1 makes a move at (0, 0). | | | | toe.move(0, 2, 2); ->

CCF-2019-12-1

落花浮王杯 提交于 2020-02-01 14:19:47
#include <iostream> using namespace std; struct info { int per; int jmp; } player[4]; int main() { int n; cin >> n; for(int i=0; i<4; ++i) { player[i].per=0; player[i].jmp=0; } for (int i=0,tem=1; i<n; ++i,++tem) { int x = tem; while(x) { if(x%10==7) { x=1; break; } else x /= 10; }//判断数字中是否有数字x if((tem%7==0)||x) { ++player[(tem-1)%4].jmp; --i; } else { player[(tem-1)%4].per = tem; } } for (int i=0; i<4; ++i) cout << player[i].jmp <<endl; return 0; } 来源: CSDN 作者: DeepThoughts 链接: https://blog.csdn.net/qq_41714738/article/details/104130334

[设计模式]代理模式

无人久伴 提交于 2020-01-29 19:09:11
1. 定义   为其他对象提供一种代理以控制对这个对象的访问。   代理模式是通过创建一个代理对象,用这个代理对象去代表真实的对象,客户端得到这个代理对象后,对客户端并没有什么影响,就跟得到了真实对象一样来使用。   当客户端操作这个代理对象的时候,实际上功能最终还是会由真实的对象来完成,只不过是通过代理操作的,也就是客户端操作代理,代理操作真正的对象。 2. 类图      Proxy: 代理对象,通常包含了以下功能,实现了与具体目标对象一样的借口,保存一个指向具体目标对象的引用,可以在需要的时候调用具体的目标对象,可以控制对具体目标对象的访问,并可以负责创建和删除它。   Subject: 目标对象,定义代理和具体目标对象的借口。   RealSubject: 具体目标对象,真正实现目标对象要求的功能。 3. 实例    package com.jerry.designpattern.proxy; /** * * @author Jerry * @date 2015年1月21日 上午10:39:09 */ public interface Player { void killMonster(); } package com.jerry.designpattern.proxy; /** * * @author Jerry * @date 2015年1月21日 上午10:46:10