Skip to content

Instantly share code, notes, and snippets.

View joshy's full-sized avatar

Joshy Cyriac joshy

  • Universitätsspital Basel
  • Basel
View GitHub Profile
@joshy
joshy / santa.dart
Last active December 30, 2015 21:39
santa.dart A try to learn dart, solution to the "santa problem" https://plus.google.com/118397406534237711570/posts/XjgFRvqtVA4
import 'dart:io';
import 'dart:async';
import 'dart:convert';
import 'dart:collection';
void main() {
print("Please, enter 'first name' and 'last name' finish with a empty line\n");
Stream cmdLine = stdin
.transform(UTF8.decoder)
.transform(new LineSplitter());
@joshy
joshy / caesar.clj
Created September 4, 2013 07:46
Simple caesar encode/decode of strings in clojure.
(ns caesar.core)
(def secret "RVAWNUEVFGJVRQREIBEORVHAQRFUNGXHPURAORQVRAGRHPU")
(def text "EINJAHRISTWIEDERVORBEIUNDESHATKUCHENBEDIENTEUCH")
(defn encode
"Encodes the text with shifting each char shift positions"
[text shift]
(apply str (map char (map #(+ (mod (+ shift %) 26) 65) (map int text)))))