Page 1 of 1

turing: project help

Posted: Mon Nov 22, 2004 9:48 pm
by Anonymous
according to posts i have read not many users know turing...but it's worth a try... :unsure: so here's my code and i need help to scramble letters in the word and everytime i try to run it ain't workin'

Code: Select all

var word := "braveheart"
var nword : int

for scramword : 1 .. length (word)
    if nword = 0 then
        nword := word (1 .. scramword - 1) + word (scramword + 1 .. *) + word (scramword)
    else
        nword := word (2 .. *) + word
    end if
    put nword
end for[code] 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:2863, old post ID:23386[/size][/color]

turing: project help

Posted: Mon Nov 22, 2004 11:35 pm
by Death
Well, from the looks of it, you'll be getting a runtime error due to the fact that you are giving a comparison for a value that does not have an assigned value. The variable NWORD should have a value BEFORE it is compared. If it does not have a value, an error occurs. See if that fixes the problem. If not, write back and tell us what the error message says.

Archived topic from Iceteks, old topic ID:2863, old post ID:23390