root_class - indexing description:...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: indexing description: "Example showing use of agents & tuples" author: "Gunnar Gotshalks" date: "2003 July 16" revision: "1.0" r class ROOT_CLASS c create make c feature {NONE} -- Creation f a : ARRAY[INTEGER] a make is-- Creation procedure. local n, i, size : INTEGER r : TUPLE [STRING, INTEGER, ARRAY[INTEGER]] tuple_str : STRING tuple_int : INTEGER tuple_arr : ARRAY[INTEGER] do io.new_line ; io.put_string("Start test") n := 5 io.new_line ; io.put_string("Sum of integers to n = ") io.put_integer(n) ; io.put_string(" is ") io.put_integer(sum_to_i(n)) io.new_line ; io.put_string(" Agent sum of integers to n = ") io.put_integer(n) ; io.put_string(" is ") io.put_integer(sum_to(n, agent identity(?))) io.new_line io.new_line ; io.put_string("Sum double of integers to n = ") io.put_integer(n) ; io.put_string(" is ") io.put_integer(sum_to_double_i(n)) io.new_line ; io.put_string(" Agent sum double of integers to n = ") io.put_integer(n) ; io.put_string(" is ") io.put_integer(sum_to(n, agent double(?))) io.new_line io.new_line ; io.put_string("Sum square of integers to n = ") io.put_integer(n) ; io.put_string(" is ") io.put_integer(sum_to_square_i(n)) io.new_line ; io.put_string(" Agent sum square of integers to n = ") io.put_integer(n) ; io.put_string(" is ") io.put_integer(sum_to(n, agent square(?))) io.new_line ; io.new_line-- Create an array with five elements...
View Full Document

This note was uploaded on 04/03/2010 for the course COMPUTER S CSE 3221 taught by Professor Hui during the Spring '10 term at York University.

Page1 / 5

root_class - indexing description:...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online