lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Now, find the error.
Make one matriz points, the part code is copy lines,
Fisrt line, only shift other line is copy, before line. Dont sucess, make the code....  no ideias.



Andreas Stenius <kaos@explosive.se> escreveu:
Apart from the code being utterly horribly hard to read, I'm not
surprised to say that it does what's it been told to do, whatever that
is. The cor_matriz[6] and [9] is 0. See test run below.

So, you'll need to keep looking in your code at what's not doing what
you want.

I added a dump before the big chunk of modifications, to ease the
debugging..

My guess could be that table.insert isn't doing what you expect,
shifting all elements up?

Regards,
Andreas

Dan - Lintouch user skrev:
> The code here http://rafb.net/paste/results/LAUnc816.html
>
> See lines 70 to 115.
>
> Problem: The variables cor_matriz[11] and cor_matriz[14] is 0.
>
> the part code, atribuition values
>
> cor_matriz[15]=cor_matriz[10]
> cor_matriz[14]=cor_matriz[9]
> cor_matriz[13]=cor_matriz[8]
> cor_matriz[12]=cor_matriz[7]
> cor_matriz[11]=cor_matriz[6]
>
> Have value not 0 in cor_matriz[6] or cor_matriz[9]
>
> Very mazy! Mystery bug
>
> ------------------------------------------------------------------------
> Yahoo! Acesso Grátis
>
> - Internet rápida e grátis. Instale o discador agora!


kaos@jenna ~/tmp $ lua LAUnc816.txt.lua




Before cor_matriz wrap or whatever
Indice:1 40
Indice:2 40
Indice:3 40
Indice:4 20
Indice:5 40
Indice:6 9
Indice:7 9
Indice:8 9
Indice:9 9
Indice:10 9
Indice:11 9
Indice:12 9
Indice:13 9
Indice:14 9
Indice:15 9
Indice:16 9
Indice:17 30
Indice:18 30
Indice:19 9
Indice:20 20

AFTER cor_matriz wrap or whatever
Indice:1 0
Indice:2 0
Indice:3 0
Indice:4 0
Indice:5 0
Indice:6 40
Indice:7 40
Indice:8 40
Indice:9 20
Indice:10 40
Indice:11 9
Indice:12 30
Indice:13 40
Indice:14 9
Indice:15 30
Indice:16 9
Indice:17 9
Indice:18 9
Indice:19 9
Indice:20 9

Exact error,not change value! - Não muda o valor! estranho, permanece zero
Indice:11 9
Indice:12 30
Indice:13 40
Indice:14 9
Indice:15 30






Before cor_matriz wrap or whatever
Indice:1 20
Indice:2 30
Indice:3 20
Indice:4 40
Indice:5 20
Indice:6 0
Indice:7 0
Indice:8 0
Indice:9 0
Indice:10 0
Indice:11 40
Indice:12 40
Indice:13 40
Indice:14 20
Indice:15 40
Indice:16 9
Indice:17 30
Indice:18 40
Indice:19 9
Indice:20 30

AFTER cor_matriz wrap or whatever
Indice:1 0
Indice:2 0
Indice:3 0
Indice:4 0
Indice:5 0
Indice:6 20
Indice:7 30
Indice:8 20
Indice:9 40
Indice:10 20
Indice:11 0
Indice:12 30
Indice:13 40
Indice:14 0
Indice:15 30
Indice:16 40
Indice:17 40
Indice:18 40
Indice:19 20
Indice:20 40

Exact error,not change value! - Não muda o valor! estranho, permanece zero
Indice:11 0
Indice:12 30
Indice:13 40
Indice:14 0
Indice:15 30


kaos@jenna ~/tmp $


Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora!