This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
算全部格子總和 v.1 | |
*/ | |
var total = 0 | |
var i = 0 //行 | |
var j = 0 //列 | |
for i in 0...7 | |
{ | |
for j in 0...7 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
定義function,接受3個參數,起始值,最大值和決定數字倍數的number, 回傳運算結果 比方起始值3, | |
最大值98,決定數字倍數的number為5時,(只包含5的倍數) 運算結果為 5 + 10 + 15 + ….. + 95 | |
*/ | |
func calNumber(starNumber:Int, maxNumber:Int, mulNumber:Int) -> Int //3個參數Int傳入值 回傳一個Int | |
{ | |
var total = 0 | |
for i in starNumber...maxNumber where i%mulNumber == 0 //當5倍數餘數為零0"做相加" | |
{ | |
total += i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
語法作業1,改寫function | |
*/ | |
func calNumber(row:Int, column:Int) -> Int //2個參數Int傳入值 回傳一個Int | |
{ | |
var total = 0 | |
for i in 0...row | |
{ | |
for j in 0...column where i%2 == 1 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// GuessNumber | |
// | |
// Created by Feng on 2016/10/27. | |
// Copyright © 2016年 Fang. All rights reserved. | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// Tipcalcultion | |
// | |
// Created by Feng on 2016/10/25. | |
// Copyright © 2016年 Fang. All rights reserved. | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Swift 25 mins ███████████████████▓░░░░ 67.1% | |
Cocoa 12 mins ███████████▒░░░░░░░░░░░░ 32.9% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PromiseKit | |
import Alamofire | |
enum HttpHeaders: String { | |
case authorization = "Authorization" | |
} | |
enum BearerToken: String { | |
case title = "Bearer " | |
} |