Skip to content

Instantly share code, notes, and snippets.

//: Playground - noun: a place where people can play
import Cocoa
// Generate the appropriate integer value for each character using
// a the ascii value from the return unicodeScalars.
// UInt8 (Unsigned 8 bit Integer)
// a | A = 1
// z | Z = 26
// all others will be 0
extension Character {
@briancordanyoung
briancordanyoung / gist:49bf65bd40ba995c9f1f9dd799ad5f68
Last active May 4, 2018 00:15
Rough code for to count the 100 point words
import Cocoa
// a = 97
// z = 122
let value = UInt8(ascii: "z")
extension Character {
var testValues: UInt8? {
@briancordanyoung
briancordanyoung / gist:3148d079b87f8b7ba65cf11c14d9d014
Last active May 4, 2018 00:16
Rough, get values of characters
import Cocoa
// a = 97
// z = 122
let value = UInt8(ascii: "z")
extension Character {
var testValues: UInt8? {
import Foundation
extension Array where Element: Hashable {
/// Returns most popular member of the array
///
/// - SeeAlso: https://en.wikipedia.org/wiki/Mode_(statistics)
///
typealias ArrayMode = (item: Element?, count: Int)
func mode() -> (item: Element?, count: Int) {