Added a few Monkey2 examples (#3811)

* Added Monkey2 (extension .monkey2) example

This compiles with the most up to date Monkey2 release (V1.1.06).

* Sorting example in Monkey2

* Add files via upload

* Gui example using the MojoX module
This commit is contained in:
DoctorWhoof
2018-01-11 01:23:54 -08:00
committed by Colin Seymour
parent db1d4f7893
commit a4e6fc78c8
4 changed files with 412 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
'Showcases use of Lambda functions and Generics.
#Import "<std>"
Using std..
Function Main()
Local testStack := New Stack< MyObject >
For Local n := 1 To 20
Local newItem := New MyObject
newItem.depth = Rnd( 0, 100 )
testStack.Push( newItem )
Next
testStack.Sort( Lambda:Int( x:MyObject,y:MyObject )
Return x.depth<=>y.depth
End )
For Local n := Eachin testStack
Print( n.depth )
Next
End
Struct MyObject
Field depth := 0
End