HoubySoft.com   up since 27.11.2007
DEPRECATED. THIS IS NO LONGER AVAILABLE IN HC 3.0 AND LATER. USE THE if(), while() and for() functions instead.
HC's simple programming language
From version 1.0, HC includes a simple programming language with a syntax similar to C, which can be used for teaching basics of programming or writing simple calculations.Supported logic operations
As of version 1.0, HC supports the following logic operators:| & / && | and, returns 1 if both of its arguments are not false |
| | / || | or, returns 1 if one of its arguments is not false |
| ! | logical NOT, returns 1 if its argument is false, 0 otherwise |
| == | equals, returns 1 if its arguments are equal |
| != | not equals, returns 1 if its arguments are not equal |
| > | larger than |
| < | smaller than |
| >= | larger or equal than |
| <= | smaller or equal than |
Supported structures
From HC version 3.0, control structures behave simply like any other function. The available structures are if(), for() and while(). To get more information, simply run help("if"), help("for") or help("while") in the HC prompt, or see below for examples of usage.Examples
P1
Solving Project Euler's first problem with HC:s = 0 for(j=0, j<1000, j+=1, if(j%3 == 0 | j%5 == 0, s+=j)) print(s)(result of this program and the solution of the problem as it was on 5.3.2010 should be 233168 )
P2
Solving Project Euler's second problem with HC:
s = 0
x = 0
j = 1
while(x <= 4000000,
x = fibo(j);
if(x%2 == 0, s+=x);
j+=1;
)
print(s)
(result of this program and the solution of the problem as it was on 5.3.2010 should be 4613732 )Back to documentation index
My git hub account