Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

init

  • Loading branch information...
commit c89fac33ed8846851131f0b1e3bb3b517e7fd13a 0 parents
Matthieu Keller authored
Showing with 32 additions and 0 deletions.
  1. +32 −0 hello.groovy
32 hello.groovy
@@ -0,0 +1,32 @@
+#!/usr/bin/env groovy
+
+println("Hello world")
+
+for (a in this.args) {
+ println("Argument: " + a)
+}
+
+mylist = [7, 42, 87, 68, 6]
+println "size " + mylist.size()
+println mylist[0]
+
+mymap = [mat:"hey", maggick:"magicien", dad:"It s my dad"]
+println mymap.dad
+println mymap.mat
+
+mymap["mat"]= "hey, it s me !"
+println mymap.mat
+
+amPM = Calendar.getInstance().get(Calendar.AM_PM)
+if (amPM == Calendar.AM)
+{
+ println("Good morning")
+} else {
+ println("Good evening")
+}
+
+square = {it * it}
+println square(9)
+
+println ([1, 2, 3, 4, 5].collect(square))
+
Please sign in to comment.
Something went wrong with that request. Please try again.