ranks

萌猿纵横字谜引擎实现过程

独自空忆成欢 提交于 2019-12-02 22:54:10
1.全部 txt 文件的方法。这个方法没有参数,返回一个全局变量 ranks ( int 型),记录读到的 txt 文件数,作为关卡总数,并把读到的 ranks 个 txt 文件中的数据放到两个字典中,字典“ arrstorage ”的 key 为关卡序数,值为一个字符串数组,字符串数组代表了一个关卡需要的矩阵(稍后首先,进入游戏之后,我们在 app.js 中写了一个从服务器指定地址获取一个文件夹中的解释这个矩阵的作用);字典“ tipsstorage ”中 key 与字典“ arrstorage ”的 key 保持一致,值为一个字符串。并把这两个字典置于缓存池中。 txt 文件格式如下图: 0000000000000 0000200003000 0001abstract0 0000r0000d000 0000r0000d000 0000a0000r000 0000y0000e000 000000000s000 000000000s000 0000000000000 0000000000000 0000000000000 0000000000000 1 把 ... 抽象出来;提出;抽出 v 2 数组;一系列 n 3 编址;寻址 v 两个字典内容示例如下: Arrstorage = {1 : [ ‘0000000000000’, ‘0000200003000’,

thinkpython2的扑克牌系列练习最终解读

本秂侑毒 提交于 2019-11-30 01:01:51
首先放上Card的代码 """This module contains a code example related to Think Python, 2nd Edition by Allen Downey http://thinkpython2.com Copyright 2015 Allen Downey License: http://creativecommons.org/licenses/by/4.0/ """ from __future__ import print_function , division import random class Card : """Represents a standard playing card. Attributes: suit: integer 0-3 rank: integer 1-13 """ suit_names = [ "Clubs" , "Diamonds" , "Hearts" , "Spades" ] rank_names = [ None , "Ace" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" , "10" , "Jack" , "Queen" , "King" ] def __init__ ( self , suit = 0 , rank = 2 ) :

2019沈阳icpc网络赛H德州扑克

守給你的承諾、 提交于 2019-11-29 14:48:35
题面: https://nanti.jisuanke.com/t/41408 题意:A,2,3,4,5,6,7,8,9,10,J,Q,K,13张牌,无花色之分,val为1~13。 给n个人名+n个牌,输出人名的ranklist 比较规则: 皇家顺最大 顺子第二,都是顺看最大牌的val 四条第三,先看四张相同牌的val,再看剩下那张牌的val 葫芦第四,先看三张相同牌的val,再看两张相同牌的val 三条第五,先看三张相同牌的val,再看剩下两张牌的val之和 两对第六,先看大的两张相同牌的val,再看小的两张相同牌的val,再看剩下一张牌的val 一对第七,先看两张相同牌的val,再看剩下三张牌的val之和 高牌第八,看五张牌的val之和 比较完还分不出来两幅牌谁赢,看名字,字典序小的赢(不会有相同的名字)。 #include<bits/stdc++.h> using namespace std; #define inf 0x3f3f3f3f typedef long long ll; const int maxn=1e5+500; struct node { string name; int ranks; int val; int a[50]; }p[maxn]; pair<int,int> calrank(int e,int d,int c,int b,int a) { //a