zoukankan      html  css  js  c++  java
  • TAROT.

    /*
     *     
     *
     */
    
    #include<stdio.h>
    #include<stdlib.h>
    #include<time.h>
    
    int main()
    {
        int tmp;
        
        int in_hand[21] = {0};
        
        char name[20];
        
        char tarot[21][50] = {
            "[0]--->(The Fool, 0)",
            "[1]--->(The Magician, I)",
            "[2]--->(The High Priestess, II)",
            "[3]--->(The Empress, III)",
            "[4]--->(The Emperor, IV)",
            "[5]--->(The Hierophant, or the Pope, V)",
            "[6]--->(The Lovers, VI)",
            "[7]--->(The Chariot, VII)",
            "[8]--->(Strength, VIII)",
            "[9]--->(The Hermit, IX)",
            "[10]--->(The Wheel of Fortune, X)",
            "[11]--->(Justice, XI)",
            "[12]--->(The Hanged Man, XII)",
            "[13]--->(Death, XIII)",
            "[14]--->(Temperance, XIV)",
            "[15]--->(The Devil, XV)",
            "[16]--->(The Tower, XVI)",
            "[17]--->(The Star, XVII)",
            "[18]--->(The Moon, XVIII)",
            "[19]--->(The Sun, XIX)",
            "[20]--->(Judgement, XX)",
            "[21]--->(The World, XXI)"
        };
        
        printf("TAROT.
    ");
        
        printf("Enter your name:");
        
        gets(name);
        
        int left_cards = 21;
        
        for(;left_cards > 0;){
            
            srand((int)time(0));
            
            tmp = rand()%21;
            
            if(!in_hand[tmp]){
                
                in_hand[tmp] = 1;
                
                if(left_cards > 1)
                    printf("%s 
    ", tarot[tmp]);
                else
                    printf("YOUR CARD:%s 
    ", tarot[tmp]);
                
                left_cards --;
            }
        }
        
        printf("
    ");
        
        return 0;
    }

    TAROT.
    Enter your name:xkfx
    [18]--->(The Moon, XVIII)
    [1]--->(The Magician, I)
    [4]--->(The Emperor, IV)
    [7]--->(The Chariot, VII)
    [10]--->(The Wheel of Fortune, X)
    [14]--->(Temperance, XIV)
    [17]--->(The Star, XVII)
    [20]--->(Judgement, XX)
    [3]--->(The Empress, III)
    [6]--->(The Lovers, VI)
    [9]--->(The Hermit, IX)
    [12]--->(The Hanged Man, XII)
    [16]--->(The Tower, XVI)
    [19]--->(The Sun, XIX)
    [8]--->(Strength, VIII)
    [11]--->(Justice, XI)
    [0]--->(The Fool, 0)
    [13]--->(Death, XIII)
    [2]--->(The High Priestess, II)
    [5]--->(The Hierophant, or the Pope, V)
    YOUR CARD:[15]--->(The Devil, XV)

  • 相关阅读:
    RabbitMQ知识梳理
    feign.FeignException: status 400 reading
    rabbitmq监控之消息确认ack
    Docker 安装redis mysql rabbitmq
    linux搭建GitLab
    杀死服务进程并重新启动,同时监听日志打印
    MySQL数据库连接报错
    idea: unable to import maven project
    线程池ThreadPool实战
    【2-SAT】URAL
  • 原文地址:https://www.cnblogs.com/xkxf/p/6041129.html
Copyright © 2011-2022 走看看