Re: Star Trek by Krishna Myneni
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Star Trek by Krishna Myneni         

Group: comp.lang.forth · Group Profile
Author: Krishna Myneni
Date: Sep 19, 2008 10:32

The Beez' wrote:
> Krishna,
>
> Are you SURE this is correct? I think this goes out of bounds for the
> n{ array!
>
> ---8<---
> 3 INTEGER array n{
> : LongRangeSensors ( -- )
> d{ 3 } f@ f0< IF
> cr ." LONG RANGE SENSORS ARE INOPERABLE"
> ELSE
> cr ." LONG RANGE SCAN FOR QUADRANT " q1 ? ." ," q2 ?
> cr ." ------------" cr
> q1 @ 2 + q1 @ 1- DO
> -1 n{ 1 } !
> -2 n{ 2 } !
> -3 n{ 3 } !
> ---8<---
>
> Hans Bezemer

Hi Hans,

I will take a closer look at the code presently. But the array/matrix
stuff is lifted from the Forth Scientific Library (FSL). FSL arrays and
matrices have a starting index of zero, so if I allocated an array with
3 elements, and used an index of 3, this would be an out of bounds
condition. Please increase the alloted array size for the array n{.

Regards,
Krishna
no comments
diggit! del.icio.us! reddit!