EnglishРусский  

   ..

   fibonacci.4.g

The project is closed! You can look at a new scripting language. It is available on GitHub.
Also, try our open source cross-platform automation software.

Ads

Installer and installation software
Commercial and Freeware installers.

source\samples\easymath\fibonacci.4.g
 1 /******************************************************************************
 2 *
 3 * Copyright (C) 2005, The Gentee Group. All rights reserved. 
 4 * This file is part of the Gentee open source project - http://www.gentee.com. 
 5 * 
 6 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE GENTEE LICENSE ("AGREEMENT"). 
 7 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES RECIPIENTS 
 8 * ACCEPTANCE OF THE AGREEMENT.
 9 *
10 * ID: fibonacci 17.10.06 0.0.A.
11 *
12 * Author: Alexey Krivonogov ( gentee )
13 *
14 ******************************************************************************/
15 
16 func main<main>
17 {
18    uint  prevprev sum, prev = 1
19    
20    print("This program displays 48 numbers of Fibonacci (Xn = Xn-1 + Xn-2)\n\n")
21 
22    print( "0\n1\n" )
23    while sum < 2000000000
24    {
25       sum = prevprev + prev
26       prevprev = prev
27       prev = sum    
28       print( "\(sum)\n" )
29    }
30    getch()
31 }
32