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

Haga clic para modificar el estilo de subttulo del patrn

ARRAY -Logo

Por: Natalia Escolar 2/1/13

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.
2/1/13

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.


2/1/13

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
2/1/13

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.


2/1/13

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.

2/1/13

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

2/1/13

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.
2/1/13

EXAMPLE

show sqrt 4

2
show sqrt 9

2/1/13

SQUARE ROOT-VISUAL BASIC


Returns a Double specifying the square root of a number.
Syntax Sqr (number) The required number argument is a
2/1/13 Double or any valid numeric

1 n1 n2 n3 s
n1> n2

Tempi A >N2 N2>N1 TempN N11> B >n3 n3? >N2 No N3>n1 Tempn N1C >n3 2> >n3 n3? N3->n2 N o N2->n3 IMPRIM O F
2/1/13

2/1/13

You might also like