Polski
huginn - programming language with no quirks, so simple every child can master it.
Fork me on GitHub git clone https://codestation.org/repo/huginn.git
git clone https://github.com/AmokHuginnsson/huginn.git
git clone https://bitbucket.org/huginn/huginn.git
  1. Syntax
  2. Keywords
  3. Types

    Huginn provides several built-in scalar and collection types, as well as user defined compound types.

    integer real string number character boolean list deque dict order lookup set
  4. Built-ins
  5. Core library classes
  6. Packages

The integer is a scalar type that is used to represent and operate on integers. It supports basic operations of addition, subtraction, multiplication, division, modulo and comparisons. The range of possible values it can hold is [-2^32, 2^32).

Editor (vim) - integer.hgn [+line no]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#! /bin/sh
exec huginn --no-argv -E "${0}" "${@}"
#! huginn

main() {
	x = 22;
	y = 333;
	p = 7;
	q = 16;
	print( "x = {}\n".format( x ) );
	print( "type of x is {}\n".format( type( x ) ) );
	n = x + y;
	print( "n = {}\n".format( n ) );
	print( "type of n is {}\n".format( type( n ) ) );
	d = p * q;
	d += 1;
	print( "d = {}\n".format( d ) );
	print( "type of d is {}\n".format( type( d ) ) );
	print( "pi ~~ {}\n".format( x / p ) );
	print( "... or pi ~~ {}\n".format( n / d ) );
	return ( 0 );
}

Program output:

Terminal - shell session [–line no]
[amok@vegeta](2/1)~/$ ./integer.hgn
x = 22
type of x is integer
n = 355
type of n is integer
d = 113
type of d is integer
pi ~~ 3
... or pi ~~ 3
[amok@vegeta](2/1)~/$