From 9e6c89f1fa93287104381e02f0bbbdd6060a9382 Mon Sep 17 00:00:00 2001 From: AidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com> Date: Sun, 5 Dec 2021 03:27:18 +0000 Subject: Added subroutines and comments for most files --- src/examples/example.ft | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src/examples') diff --git a/src/examples/example.ft b/src/examples/example.ft index 4a4981a..ab5143d 100644 --- a/src/examples/example.ft +++ b/src/examples/example.ft @@ -1,15 +1,20 @@ program example -int ::test -int::testtwo -test=5 -testtwo=7 -int::testthree -testthree=add(test,testtwo) -print*,testthree +int::a +int::b +int::c +a=2+3 +b=3 +c=power(a,b) +print*,c end program example -function int add(int a, int b) -int::value -value=a+b -return value + +function int power(int value,int power) +int::i +int::final +final=1 +do i=0,power-1 +final=final*value +end do +return final end \ No newline at end of file -- cgit v1.2.3