zoukankan      html  css  js  c++  java
  • 3_Guess Fingers

    3

    //
    //  ViewController.swift
    //  Guess Fingers
    //
    //  Created by ZC on 16/1/8.
    //  Copyright © 2016年 ZC. All rights reserved.
    //
    
    import UIKit
    
    class ViewController: UIViewController {
        
        @IBOutlet weak var UserGuessTextField: UITextField!
        
        @IBOutlet weak var Result: UILabel!
        
        @IBAction func Check(sender: AnyObject) {
            
            let rand = String(arc4random_uniform(6))
            
            if UserGuessTextField.text?.isEmpty == true {
                Result.text = "Please input your guess number!"
            }else if UserGuessTextField.text == rand {
                Result.text = "Great! The number is " + rand
            }else {
                Result.text = "Sorry, the correct number is " + rand + " !"
            }
        }
        
        override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view, typically from a nib.
        }
    
        override func didReceiveMemoryWarning() {
            super.didReceiveMemoryWarning()
            // Dispose of any resources that can be recreated.
        }
    
    
    }
    

    项目:3_Guess Fingers

  • 相关阅读:
    poj 2312 Battle City
    poj 2002 Squares
    poj 3641 Pseudoprime numbers
    poj 3580 SuperMemo
    poj 3281 Dining
    poj 3259 Wormholes
    poj 3080 Blue Jeans
    poj 3070 Fibonacci
    poj 2887 Big String
    poj 2631 Roads in the North
  • 原文地址:https://www.cnblogs.com/zcdll/p/5161002.html
Copyright © 2011-2022 走看看