huginn - programming language with no quirks, so simple every child can master it.

git clone https://codestation.org/repo/huginn.git
git clone https://github.com/AmokHuginnsson/huginn.git
git clone https://bitbucket.org/huginn/huginn.git
-
Syntax
-
Keywords
-
Types
-
Built-ins
-
Core library classes
-
Packages
break
statement
Break from while
loop:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /bin/sh exec huginn --no-argv -E "${0}" "${@}" #! huginn main() { while ( ( line = input() ) != none ) { line = line.strip(); x = integer( line ); if ( x > 10 ) { print( "{} is too much for me :(\n".format( line ) ); break; } print( "{} squared is {}\n".format( line, x * x ) ); } return ( 0 ); }
Program output:
[amok@vegeta](2/1)~/$ echo '1\n2\n4\n8\n16\n32' | ./break-while.hgn 1 squared is 1 2 squared is 4 4 squared is 16 8 squared is 64 16 is too much for me :( [amok@vegeta](2/1)~/$
Break from for
loop:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/sh exec huginn -E "${0}" "${@}" #! huginn main( argv_ ) { badWords = set( "equality", "nurture", "environment" ); skipOnce = true; for ( w : argv_ ) { if ( skipOnce ) { skipOnce = false; continue; } if ( badWords.has_key( w ) ) { print( "I wholeheartedly reject {},\n" "commie propaganda won't fly here, bye.\n".format( w ) ); break; } print( "I can like this {} thingy :)\n".format( w ) ); } return ( 0 ); }
Program output:
[amok@vegeta](2/1)~/$ ./break-for.hgn liberty property\ rights capitalism equality environment nurture I can like this liberty thingy :) I can like this property rights thingy :) I can like this capitalism thingy :) I wholeheartedly reject equality, commie propaganda won't fly here, bye. [amok@vegeta](2/1)~/$