UwUpp icon indicating copy to clipboard operation
UwUpp copied to clipboard

pwus stiches strings together instead of adding them

Open EldosHD opened this issue 3 years ago • 2 comments

Sorry for bothering you again. While experimenting I encountered a problem. (Again im not sure if its a bug or im just stupid)

This is my code:

data iws wead("test.txt")

index iws 2
counter iws 0
sum iws 0
prevSum iws 0


UwU This is an while loop
OwO *notices index wess twan wength(data)*
    current iws data[index]
    minus1 iws data[index minwus 1]
    minus2 iws data[index minwus 2]
    sum iws current pwus minus1 pwus minus2
    
    nuzzels(sum)
    
    index iws index pwus 1
stawp

This is test.txt:

199
200
208
210
200
207
240
269
260
263

It should just sum up the current element with the last two, but instead it joins the strings together, which results in the following output:

208200199
210208200
200210208
207200210
240207200
269240207
260269240
263260269

Am I doing something wrong?

EldosHD avatar Dec 05 '21 00:12 EldosHD

Currently the implementation of wead() returns an array of strings, I must have changed it while trying to get the compiler working.

As a hotfix i can add another function weadInts(file) later today, though until then you could try using wistenInt​ which reads a line from stdin into an int value.

Deltaphish avatar Dec 05 '21 08:12 Deltaphish

Ok thx for the hotfix. Ill try that

EldosHD avatar Dec 05 '21 11:12 EldosHD