Author Topic: Pxl-On troubles  (Read 3614 times)

0 Members and 1 Guest are viewing this topic.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Pxl-On troubles
« on: March 12, 2010, 03:15:58 pm »
Ok, so I know I'm doing something dumb in these line of code but I can't figure out what it is.

Code: [Select]
If sub(Str1,AW-W+C,1)≠Str2
Pxl-On(A-1,B

That's not all the code but I'm pretty sure my error is happening there. (It isn't turning on the right pixels.) I can provide more if nothing is seen wrong. Thanks for any help :)
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline trevmeister66

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1009
  • Rating: +14/-5
    • View Profile
Re: Pxl-On troubles
« Reply #1 on: March 12, 2010, 03:22:00 pm »
Is A your X or your Y Variable? Because Pxl is (X,Y) I believe, while Pt is (Y,X). or vice versa, i can't remember exactly
Projects:    nameless RPG: 1.0%  |  Reverse Snake v1.5: 100%  |  Secret Project: 5%  |  DUNGEON: 70%

My MW2 Blog <-- Please visit :)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Pxl-On troubles
« Reply #2 on: March 12, 2010, 03:23:52 pm »
Well it isn't that it is displaying in the wrong place, is that it is recognizing everything as being true (therefore turning all pixels on and not skipping any). Sorry for not specifying.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Radical Pi

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1143
  • Rating: +5/-2
    • View Profile
    • RealityRevolution
Re: Pxl-On troubles
« Reply #3 on: March 12, 2010, 03:24:38 pm »
Pt is (X,Y), like how normal points are written.
Pxl is (Y,X) like Output( is for the homescreen.

It would help to know what the variables represent (although I have a good idea already ;)) and what the strings are.
« Last Edit: March 12, 2010, 03:25:44 pm by Nyrax »
One of these days I'll get a sig I'm really proud of.

Offline trevmeister66

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1009
  • Rating: +14/-5
    • View Profile
Re: Pxl-On troubles
« Reply #4 on: March 12, 2010, 03:26:15 pm »
Well what ever you're getting out of Str1 is going to only be 1 character long, so if Str2 is longer than 1 character, then it will never be true
Projects:    nameless RPG: 1.0%  |  Reverse Snake v1.5: 100%  |  Secret Project: 5%  |  DUNGEON: 70%

My MW2 Blog <-- Please visit :)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Pxl-On troubles
« Reply #5 on: March 12, 2010, 03:41:32 pm »
Haha ya, Nyrax you probably do. It has to do with a String►Pic program. I'm just trying not to release to much...yet :P
Str1 is your map.
Str2 is your the character you can move over (space for example).
W is the width of the map.
A is the y-value.
B is the x-value.
C helps locate the location in the String.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Radical Pi

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1143
  • Rating: +5/-2
    • View Profile
    • RealityRevolution
Re: Pxl-On troubles
« Reply #6 on: March 12, 2010, 04:06:11 pm »
Like trevmeister said, are you sure that length(Str2)=1? If it is then all I can think of is to double check that A, W, and C are all still the right values when that piece of code executes.
One of these days I'll get a sig I'm really proud of.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Pxl-On troubles
« Reply #7 on: March 12, 2010, 04:10:56 pm »
Ya because you enter it manually. It's not something that is preset. But thanks you guys. I'll go over it and see what I come up with.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline trevmeister66

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1009
  • Rating: +14/-5
    • View Profile
Re: Pxl-On troubles
« Reply #8 on: March 12, 2010, 04:14:12 pm »
Hmm yeah it probably has to do with your variables then. Maybe the algebra is wrong or something, although from what it looks like, it seems fine. Good luck with finding out the bug
Projects:    nameless RPG: 1.0%  |  Reverse Snake v1.5: 100%  |  Secret Project: 5%  |  DUNGEON: 70%

My MW2 Blog <-- Please visit :)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Pxl-On troubles
« Reply #9 on: March 12, 2010, 04:22:10 pm »
Grrr, I can't figure it out! I keep coming up with the same things :P
I'm just gonna show all the code and see what you guys see. Maybe that will shed some light on it.

Code: [Select]
PROGRAM:CNVRTSP
ClrDraw
AxesOff
FnOff
Input "WIDTH: ",W
Input "HEIGHT: ",H
Input "SPACE CHARACTER:",Str2
For(A,1,H
1→C
For(B,1,W
If sub(Str1,AW-W+C,1)≠Str2
Pxl-On(A-1,B-1
End
End
StorePic Pic1

I realize this is probably not optimized, I'm just getting the programs so they work and then going from there.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Radical Pi

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1143
  • Rating: +5/-2
    • View Profile
    • RealityRevolution
Re: Pxl-On troubles
« Reply #10 on: March 12, 2010, 04:59:11 pm »
You don't even need C. Take the substring at AW-W+B like so:

Code: [Select]
PROGRAM:CNVRTSP
ClrDraw
AxesOff
FnOff
Input "WIDTH: ",W
Input "HEIGHT: ",H
Input "SPACE CHARACTER:",Str2
For(A,1,H
For(B,1,W
If sub(Str1,AW-W+B,1)≠Str2
Pxl-On(A-1,B-1
End
End
StorePic Pic1
One of these days I'll get a sig I'm really proud of.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Pxl-On troubles
« Reply #11 on: March 12, 2010, 05:06:35 pm »
Ooooooooooook, I see what I did now. I wasn't increasing C by one each time like it should have been. But ya, you're right, C isn't needed. Thanks :D
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)