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
;; try1.clj | |
(require '[clojure.string :as str]) | |
(defn count-palindromes | |
[max] | |
(let [n (atom 0)] | |
(doseq [i (range 10 max)] | |
(let [i-str (str i) | |
i-rstr (str/reverse i-str)] |
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
(ns text-example.core | |
(require [quil.core :as q]) | |
(:gen-class)) | |
(def screen-width 640) | |
(def screen-height 480) | |
(def blue [53 108 237]) | |
(def yellow [235 229 20]) |
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
(ns my-quil-app.core | |
(:require [quil.core :as q]) | |
(:gen-class)) | |
;; `setup` is called once when we start up. | |
(defn setup [] | |
(q/smooth) ;; Turn on anti-aliasing. | |
(q/frame-rate 1) ;; Set framerate to 1 FPS. | |
(q/background 200)) ;; Set the background colour to | |
;; a nice shade of grey. |
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
struct Point { | |
x: float, | |
y: float, | |
} | |
enum Shape { | |
Circle(Point, float), | |
Rectangle(Point, Point), | |
} |
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
hi | |
* first item in bulleted list | |
second paragraph of first item | |
code block | |
in first item | |
second paragraph in first item |
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
# Announce: Rakudo Star | |
## A useful, usable, "early adopter" distribution of Perl 6 | |
On behalf of the Rakudo and Perl 6 development teams, I'm happy to | |
announce the MONTH 2013 release of "Rakudo Star", a useful and usable | |
distribution of Perl 6. The tarball for the MONTH 2013 release is | |
available from <http://rakudo.org/downloads/star/>. A Windows .MSI | |
version of Rakudo star will usually appear in the downloads area | |
shortly after the tarball release. |
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
# Announce: Rakudo Perl 6 compiler, Development Release #NN ("NAME") | |
On behalf of the Rakudo development team, I'm proud to announce the | |
MONTH 2013 release of Rakudo Perl #NN "NAME". Rakudo is an | |
implementation of Perl 6 on the Parrot Virtual Machine (see | |
<http://www.parrot.org>). The tarball for this release is available | |
from <http://rakudo.org/downloads/rakudo/>. | |
Please note: This announcement is not for the Rakudo Star | |
distribution[^1] --- it's announcing a new release of the compiler |
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
basics.md | |
pod.md | |
variables.md | |
numbers-and-math.md | |
strings-and-unicode.md | |
lists-and-arrays.md | |
hashes.md | |
types.md | |
context.md | |
nested-data-structures.md |
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
#!/usr/bin/env perl | |
use Modern::Perl; | |
#use diagnostics; | |
use List::Util qw/max min sum/; | |
# TODO: more of the following code needs to be put into functions | |
if (@ARGV != 1) { | |
say "Please pass exactly one arg: the number of"; |
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
(map + [1 2 3 4 5] | |
[6 7 8 9 10]) | |
;; => ((+ 1 6) | |
; (+ 2 7) | |
; (+ 3 8) | |
; (+ 4 9) | |
; (+ 5 10)) | |
;;---------------------------------- |