Skip to content

Instantly share code, notes, and snippets.

@ykon
ykon / fizzbuzz.elm
Created November 23, 2017 12:52
FizzBuzz in Elm
{--
Copyright (c) 2017 Yuki Ono
Licensed under the MIT License.
--}
import Html exposing (..)
import List
import String
type FizzBuzzType
@ykon
ykon / Program.cs
Last active November 19, 2017 15:11
sendmail test
/*
* Copyright (c) 2017 Yuki Ono
* Licensed under the MIT License.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;
@ykon
ykon / Program.cs
Last active November 14, 2017 15:02
Mail Parser in C# (in development)
/*
* Copyright (c) 2017 Yuki Ono
* Licensed under the MIT License.
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
@ykon
ykon / ARC4.scala
Last active October 29, 2017 03:31
ARC4 in Scala
/*
* Copyright (c) 2017 Yuki Ono
* Licensed under the MIT License.
*/
package func_arc4
import scala.annotation.tailrec
object ARC4 extends App {
@ykon
ykon / Base64.scala
Last active October 25, 2017 13:37
Base64 in Scala
/*
* Copyright (c) 2017 Yuki Ono
* Licensed under the MIT License.
*/
package func_base64
// https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64
object Base64 extends App {
private val base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
@ykon
ykon / Hex.fs
Last active October 25, 2017 13:48
Hex string in F#
(*
* Copyright (c) 2017 Yuki Ono
* Licensed under the MIT License.
*)
open System
open System.Text
let proceduralEncode (bytes:byte[]): string =
let sb = new StringBuilder(bytes.Length * 2)
@ykon
ykon / Hex.scala
Last active October 24, 2017 13:04
Hex string in Scala
/*
* Copyright (c) 2017 Yuki Ono
* Licensed under the MIT License.
*/
package func_hex
import Integer.toHexString
import Integer.parseInt
@ykon
ykon / Program.fs
Last active October 24, 2017 13:18
Basic FP in F#
(*
* Copyright (c) 2017 Yuki Ono
* Licensed under the MIT License.
*)
open System
open System.Collections.Generic
let proceduralSum (ns:int list): int =
let mutable sum = 0
@ykon
ykon / Main.scala
Last active October 29, 2017 03:45
Basic FP in Scala
/*
* Copyright (c) 2017 Yuki Ono
* Licensed under the MIT License.
*/
package func_basic
import scala.annotation.tailrec
object Main extends App {
@ykon
ykon / main.rs
Created October 15, 2017 14:53
FizzBuzz in Rust
/*
* Copyright (c) 2017 Yuki Ono
* Licensed under the MIT License.
*/
fn common_fizzbuzz() {
println!("common_fizzbuzz");
let mut i = 1;
while i <= 100 {