Examples in Gambas (#5) by @vdelacruzjardon
This commit is contained in:
committed by
Aditya Bhargava
parent
e2a4153e80
commit
0aec97dbf2
BIN
03_recursion/gambas/01_countdown/.gambas/COUNTDOWN
Normal file
BIN
03_recursion/gambas/01_countdown/.gambas/COUNTDOWN
Normal file
Binary file not shown.
7
03_recursion/gambas/01_countdown/.project
Normal file
7
03_recursion/gambas/01_countdown/.project
Normal file
@@ -0,0 +1,7 @@
|
||||
# Gambas Project File 3.0
|
||||
# Compiled with Gambas 3.5.4
|
||||
Title=01_countdown
|
||||
Startup=countdown
|
||||
Version=0.0.1
|
||||
TabSize=2
|
||||
Packager=1
|
||||
15
03_recursion/gambas/01_countdown/.src/countdown.module
Normal file
15
03_recursion/gambas/01_countdown/.src/countdown.module
Normal file
@@ -0,0 +1,15 @@
|
||||
' Gambas module file
|
||||
|
||||
Function countdown(i As Integer) As Integer
|
||||
Print i
|
||||
If i <= 0 Then
|
||||
Return
|
||||
Else
|
||||
countdown(i - 1)
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Sub Main()
|
||||
countdown(5)
|
||||
End
|
||||
7
03_recursion/gambas/01_countdown/.startup
Normal file
7
03_recursion/gambas/01_countdown/.startup
Normal file
@@ -0,0 +1,7 @@
|
||||
countdown
|
||||
01_countdown
|
||||
0
|
||||
0
|
||||
0.0.1
|
||||
|
||||
|
||||
BIN
03_recursion/gambas/02_greet/.gambas/GREET
Normal file
BIN
03_recursion/gambas/02_greet/.gambas/GREET
Normal file
Binary file not shown.
7
03_recursion/gambas/02_greet/.project
Normal file
7
03_recursion/gambas/02_greet/.project
Normal file
@@ -0,0 +1,7 @@
|
||||
# Gambas Project File 3.0
|
||||
# Compiled with Gambas 3.5.4
|
||||
Title=02_greet
|
||||
Startup=greet
|
||||
Version=0.0.1
|
||||
TabSize=2
|
||||
Packager=1
|
||||
17
03_recursion/gambas/02_greet/.src/greet.module
Normal file
17
03_recursion/gambas/02_greet/.src/greet.module
Normal file
@@ -0,0 +1,17 @@
|
||||
' Gambas module file
|
||||
|
||||
Function greet2(name As String)
|
||||
Print "how are you, "; name; "?"
|
||||
End
|
||||
Function bye()
|
||||
Print "ok bye!"
|
||||
End
|
||||
Function greet(name As String)
|
||||
Print "hello, "; name; "!"
|
||||
greet2(name)
|
||||
Print "getting ready to say bye..."
|
||||
bye()
|
||||
End
|
||||
Public Sub Main()
|
||||
greet("adit")
|
||||
End
|
||||
7
03_recursion/gambas/02_greet/.startup
Normal file
7
03_recursion/gambas/02_greet/.startup
Normal file
@@ -0,0 +1,7 @@
|
||||
greet
|
||||
02_greet
|
||||
0
|
||||
0
|
||||
0.0.1
|
||||
|
||||
|
||||
BIN
03_recursion/gambas/03_factorial/.gambas/FACTORIAL
Normal file
BIN
03_recursion/gambas/03_factorial/.gambas/FACTORIAL
Normal file
Binary file not shown.
7
03_recursion/gambas/03_factorial/.project
Normal file
7
03_recursion/gambas/03_factorial/.project
Normal file
@@ -0,0 +1,7 @@
|
||||
# Gambas Project File 3.0
|
||||
# Compiled with Gambas 3.5.4
|
||||
Title=03_factorial
|
||||
Startup=factorial
|
||||
Version=0.0.1
|
||||
TabSize=2
|
||||
Packager=1
|
||||
14
03_recursion/gambas/03_factorial/.src/factorial.module
Normal file
14
03_recursion/gambas/03_factorial/.src/factorial.module
Normal file
@@ -0,0 +1,14 @@
|
||||
' Gambas module file
|
||||
|
||||
Function fact(x As Float) As Float
|
||||
If x = 1 Then
|
||||
Return 1
|
||||
Else
|
||||
Return x * fact(x - 1)
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Sub Main()
|
||||
Print fact(5)
|
||||
End
|
||||
7
03_recursion/gambas/03_factorial/.startup
Normal file
7
03_recursion/gambas/03_factorial/.startup
Normal file
@@ -0,0 +1,7 @@
|
||||
factorial
|
||||
03_factorial
|
||||
0
|
||||
0
|
||||
0.0.1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user