Skip to content

Commit 2198c16

Browse files
authored
Merge pull request #2038 from subhayuroy/master
Added HelloWorld and Fibonacci in Boo
2 parents 939f812 + c6ac053 commit 2198c16

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

archive/b/boo/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Sample Programs in Boo
2+
3+
Welcome to Sample Programs in Boo!
4+
5+
## Sample Programs
6+
7+
- [Hello World in Boo][1]
8+
- [Fibonacci][2]
9+
10+
11+
## Fun Facts
12+
13+
- Debut: 2003
14+
15+
## References
16+
17+
- [Boo Wiki][3]
18+
19+
20+
[1]: https://github.com/subhayuroy/sample-programs/blob/master/archive/b/boo/helloworld.boo
21+
[2]: https://github.com/subhayuroy/sample-programs/blob/master/archive/b/boo/fibonacci.boo
22+
[3]: https://en.wikipedia.org/wiki/Boo_(programming_language)

archive/b/boo/fibonacci.boo

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def fib():
2+
a, b = 0L, 1L # The 'L's make the numbers double word length (typically 64 bits)
3+
while true:
4+
yield b
5+
a, b = b, a + b
6+
7+
# Print the first 5 numbers in the series:
8+
for index as int, element in zip(range(5), fib()):
9+
print("${index+1}: ${element}")

archive/b/boo/helloworld.boo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print "Hello, World!"

0 commit comments

Comments
 (0)