File: test_script3.kscript

package info (click to toggle)
castle-game-engine 6.4%2Bdfsg1-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 195,044 kB
  • sloc: pascal: 364,622; ansic: 8,606; java: 2,851; objc: 2,601; cpp: 1,412; xml: 851; makefile: 723; sh: 563; php: 26
file content (22 lines) | stat: -rw-r--r-- 540 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function main()
  my_int := 12;
  my_bool := false;
  my_float := 0;
  if (my_int > 23, my_float := 13, my_bool := true)

function main_alt()
  my_int := 44;
  my_bool := false;
  my_float := 0;
  if (my_int > 23, my_float := 13, my_bool := true)

function main_alt_while()
  my_int := 0;
  my_string := 'foo';
  while(my_int := my_int + 1; my_int <= 12,
    my_string := my_string + ' ' + string(my_int))

{ just a test of for() loop }
function main_alt_for()
  my_string := 'foo';
  for(my_int, 4, 14, my_string := 'x' + my_string + 'x')