Codigo de Ejercicio:
//
// ViewController.swift
// RandomNumber
// JEHOVANI DE JESUS CHAVEZ SEGOVIA 2561842011
import UIKit
class ViewController: UIViewController {
@IBOutlet var randomNumber: UILabel!
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.
}
@IBAction func seed(sender: UIButton) {
srandom(CUnsignedInt(time(nil)))
randomNumber.text="Generator Seeded"
}
@IBAction func generate(sender: UIButton) {
var generated=(random()%100)+1
randomNumber.text="\(generated)"
}
}