Skip to content

Instantly share code, notes, and snippets.

View kiras0518's full-sized avatar
🏠
Working from home

Ting君 kiras0518

🏠
Working from home
  • Taiwan
View GitHub Profile
@kiras0518
kiras0518 / PromiseKit+Alamofire.swift
Last active April 10, 2024 15:01
PromiseKit + Alamofire
import PromiseKit
import Alamofire
enum HttpHeaders: String {
case authorization = "Authorization"
}
enum BearerToken: String {
case title = "Bearer "
}
@kiras0518
kiras0518 / 📊 Weekly development breakdown
Last active November 11, 2022 18:45
development breakdown
Swift 25 mins ███████████████████▓░░░░ 67.1%
Cocoa 12 mins ███████████▒░░░░░░░░░░░░ 32.9%
//
// ViewController.swift
// Tipcalcultion
//
// Created by Feng on 2016/10/25.
// Copyright © 2016年 Fang. All rights reserved.
//
import UIKit
//
// ViewController.swift
// GuessNumber
//
// Created by Feng on 2016/10/27.
// Copyright © 2016年 Fang. All rights reserved.
//
import UIKit
/*
語法作業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
{
/*
定義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
/*
算全部格子總和 v.1
*/
var total = 0
var i = 0 //行
var j = 0 //列
for i in 0...7
{
for j in 0...7
{