X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;ds=sidebyside;f=Tasks%2FExamples.icl;h=4ca051dc16591587190d2ec3936111a51dd8125b;hb=a81623aa9629a3c5c8f8bf920e494a596b30c4b7;hp=78b0d678eb7d45557333e1e6741acca1ecf8ceec;hpb=cb452795ab772fb465e7675b22865eb1ff25cf53;p=mTask.git diff --git a/Tasks/Examples.icl b/Tasks/Examples.icl index 78b0d67..4ca051d 100644 --- a/Tasks/Examples.icl +++ b/Tasks/Examples.icl @@ -6,14 +6,18 @@ import mTask import Devices.mTaskDevice import iTasks._Framework.Serialization -countTo5 :: Main (ByteCode () Stmt) -countTo5 = sds \x=0 In {main = - x =. x +. lit 1 :. - pub x :. - IF ( x >. lit 5) ( - retrn x +pinShare :: Main (ByteCode () Stmt) +pinShare = sds \p=True In {main = + d0 =. p :. noOp + } + +faculty :: Int -> Main (ByteCode () Stmt) +faculty i = sds \y=i In sds \x=1 In {main = + IF (y <=. lit 1) ( + pub x :. retrn ) ( - noOp + x =. x *. y :. + y =. y -. lit 1 )} count :: Main (ByteCode () Stmt) @@ -77,5 +81,6 @@ allmTasks = 'DM'.fromList ,("blink", ledSelection @ blink) ,("blinkShare", treturn blinkShare) ,("count", treturn count) - ,("countTo5", treturn countTo5) + ,("faculty", enterInformation "Faculty" [] @ faculty) + ,("pinShare", treturn pinShare) ]