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. Before | |
static var titles: [String] { | |
var i = 0 | |
var titles: [String] = [] | |
while let categoryTitle = StudyCategory(rawValue: i)?.title { | |
titles.append(categoryTitle) | |
i += 1 | |
} | |
return titles | |
} |
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
//: Playground - noun: a place where people can play | |
func uniqueString(name: String, list: [String]) -> String { | |
var suffix = 0 | |
func nameCheck(n: String) -> String { | |
var localName = n | |
guard list.contains(localName) else { return n } | |
suffix += 1 | |
localName = name + "-\(suffix)" |
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
// | |
// RequestManager.swift | |
// APISearchControllerTutorial | |
// | |
// Created by Kc on 24/03/2016. | |
// Copyright © 2016 Kenechi Okolo. All rights reserved. | |
// | |
import Foundation | |
import Alamofire |
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 | |
// NSTimerTutorial | |
// | |
// Created by Kc on 22/02/2016. | |
// Copyright © 2016 Kenechi Okolo. 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
// | |
// OurTableViewController.swift | |
// TableView Tutorial | |
// | |
// Created by Kc on 02/11/2015. | |
// Copyright © 2015 Kenechi Okolo. 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
// MARK: Export functions | |
func createExportString() -> String { | |
var date: NSDate? = NSDate() | |
var worktime: Double? | |
var breaktime: Double? | |
var studyRate: Double? | |
var studyQuota: Double? | |
var hoursLeft: Int? | |
var distractionCount: Int? |
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
/* | |
* File: HangmanLexicon.java | |
* ------------------------- | |
* This file contains a stub implementation of the HangmanLexicon | |
* class that you will reimplement for Part III of the assignment. | |
*/ | |
import java.util.*; | |
import java.io.*; |
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
/* | |
* File: HangmanCanvas.java | |
* ------------------------ | |
* This file keeps track of the Hangman display. | |
*/ | |
import acm.graphics.*; | |
public class HangmanCanvas extends GCanvas { |
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 acm.graphics.*; | |
import acm.program.*; | |
import acm.util.*; | |
import java.awt.*; | |
public class Hangman_II extends ConsoleProgram { | |
private final static int N_HANGMAN_PARTS = 8; // number of parts to draw to complete hangman drawing | |
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 acm.graphics.*; | |
import acm.program.*; | |
import acm.util.*; | |
import java.awt.*; | |
public class Hangman_II extends ConsoleProgram { | |
public HangmanLexicon lexicon = new HangmanLexicon(); // creates an object of type HangmanLexicon | |
private final static int N_HANGMAN_PARTS = 8; // number of parts to draw to complete hangman drawing |
NewerOlder