diff options
Diffstat (limited to 'AppPkg/Applications/Lua/scripts')
-rw-r--r-- | AppPkg/Applications/Lua/scripts/Fact.lua | 12 | ||||
-rw-r--r-- | AppPkg/Applications/Lua/scripts/Hello.lua | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/AppPkg/Applications/Lua/scripts/Fact.lua b/AppPkg/Applications/Lua/scripts/Fact.lua new file mode 100644 index 0000000000..b935c7a04f --- /dev/null +++ b/AppPkg/Applications/Lua/scripts/Fact.lua @@ -0,0 +1,12 @@ +-- defines a factorial function
+function fact (n)
+ if n == 0 then
+ return 1
+ else
+ return n * fact(n-1)
+ end
+end
+
+print("enter a number:")
+a = io.read("*number") -- read a number
+print(fact(a))
diff --git a/AppPkg/Applications/Lua/scripts/Hello.lua b/AppPkg/Applications/Lua/scripts/Hello.lua new file mode 100644 index 0000000000..2c0afef009 --- /dev/null +++ b/AppPkg/Applications/Lua/scripts/Hello.lua @@ -0,0 +1 @@ +print("Hello UEFI World")
|