Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

ARRAY -LOGO

Por: Natalia Escolar

Lo que estamos haciendo en el programa de logo, es hacer que el programa nos ordene 3 nmeros los cuales le pedimos, y para eso hay que usar las siguiente instrucciones, y seguir el diagrama de flujo que esta al final de la presentacin, junto con una foto de cmo quedara el procedimiento para que el programa nos ordene los 3 nmeros que queramos.

MD ARRAY-LOGO
mdarray MDARRAY sizelist mdarray (MDARRAY sizelist origin) Outputs a multi-dimensional array. The first input must be a list

of one or more positive integers. The second input, if present, must be a single integer that applies to every dimension of the array.
Mdarray: (MDARRAY) Newly formed multi-dimensional array. Sizelist: (LIST) List of sizes (each an integer) of the new multi-

dimensional array.

Origin: (INTEGER) Where to start indexing the new multi-

dimensional array.

EXAMPLE
make "myarray (mdarray [2 3] 0) mdsetitem [0 0] :myarray 1 mdsetitem [0 1] :myarray 2 mdsetitem [0 2] :myarray 3 mdsetitem [1 0] :myarray 4 mdsetitem [1 1] :myarray 5 mdsetitem [1 2] :myarray 6 show :myarray {{1 2 3} {4 5 6}}

ARRAY-VISUAL BASIC
The required a list argument is a comma-

delimited list of values that are assigned to the elements of the array contained within the variant.

If no arguments are specified, an array of zero

length is created.

REMARKS

The notation used to refer to an element of an array consists of the variable name followed by parentheses containing an index number indicating the desired element.

In the following example, the first statement creates a variable named A as a Variant. The second statement assigns an array to variable A. The last statement assigns the value contained in the second array element to another variable

SQUARE ROOT-LOGO
num SQRT num1 Outputs the square root of the input, which

must be nonnegative. num:(NUMBER) Result of square root of num. num1:(NUMBER) Number to take sign of.

EXAMPLE

show sqrt 4

2 show sqrt 9 3

SQUARE ROOT-VISUAL BASIC


Returns a Double specifying the square root of a number.
Syntax

Sqr (number)
The required number argument is a Double or

any valid numeric expression greater than or equal to zero.

1
n1 n2 n3

si
n1>n2

Temp->N2 N2->N1 N1->N2

N1 >n3 ?

Temp->n3 N3->n1 N1->n3


No Temp->n3 N3->n2 N2->n3

n2
>n3?

No

IMPRIMO

You might also like