This file contains hidden or 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
// ************************************* Types ******************************************************** | |
public interface IEither<A, B> | |
where A : notnull | |
where B : notnull { | |
public IEither<A, Result> Map<Result>(Func<B, Result> transform) where Result : notnull; | |
public B UnwrapOr(B b); | |
public B GetOrHandle(Func<A, B> handler); |
This file contains hidden or 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
open System | |
let getDie = | |
let rand = new Random() | |
fun() -> rand.Next(1, 7) | |
let myDice numDice = [for i in 1 .. numDice do yield getDie()] | |
//Only single ones and fives are scored |
This file contains hidden or 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
open System | |
let getDie = | |
let rand = new Random() | |
fun() -> rand.Next(1, 7) | |
let myDice numDice = [for i in 1 .. numDice do yield getDie()] | |
This file contains hidden or 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
package main | |
import "fmt" | |
func main() { | |
fmt.Println("Hello Go!") | |
testArr := arrayWrapper{array: []int{1, 2, 3, 4, 5}} | |
randomArr := testArr.Map(func(x int) int { return x * 2 }) |
This file contains hidden or 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
fn main() { | |
let map1 = "abcdefghijklmnopqrstuvwxyz"; | |
let map2 = "cbaefdihglkmpjonsrqvutkwzy"; | |
let cipher = Cipher::new(map1, map2); | |
let encoded = cipher.encode("I'm coding right now"); | |
println!("{}", encoded); |
This file contains hidden or 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
//students array | |
var students = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; | |
//size of group | |
var sizeOfGroup = 4; | |
//concept for filtering sutdents | |
var gradeSort = []; | |
//determine number of groups | |
function findNumGroups(studentsArr, groupSize) { |
This file contains hidden or 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 achievementScore(talent, effort) { | |
var skill = talent * effort; | |
var achievement = skill * effort; | |
console.log(achievement); | |
} |