Author Topic: PxlOn 1,1 works, but not PxlOn X,Y?? (PRIZM BASIC)  (Read 5568 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
PxlOn 1,1 works, but not PxlOn X,Y?? (PRIZM BASIC)
« on: February 03, 2014, 07:11:39 pm »
Could someone explain to me why the following PRIZM BASIC code works,

Code: [Select]
For 1->X To 300
For 1->Y To 216
Blue PxlOn 1,1
Next
Next

but not the following?

Code: [Select]
For 1->X To 300
For 1->Y To 216
Blue PxlOn X,Y
Next
Next

The 2nd piece of code gives the following error: "Input value must be integer"?

Is this a PRIZM glitch or is it actually impossible to use variables as arguments for pixel drawing commands? O.O
« Last Edit: February 03, 2014, 08:12:31 pm by DJ Omnimaga »

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: PxlOn 1,1 works, but not PxlOn X,Y?? (PRIZM BASIC)
« Reply #1 on: February 03, 2014, 08:29:37 pm »
Did you try using just the body of the loop?
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline Lunar Fire

  • LV3 Member (Next: 100)
  • ***
  • Posts: 66
  • Rating: +7/-1
  • I'll be watching you from the shadows
    • View Profile
    • My Tumblr
Re: PxlOn 1,1 works, but not PxlOn X,Y?? (PRIZM BASIC)
« Reply #2 on: February 03, 2014, 09:08:53 pm »
Did you try specifying the step of the loop to 1, like this:

Code: [Select]
For 1->X To 300 Step 1
For 1->Y To 216 Step 1
Blue PxlOn X,Y
Next
Next

My guess is the basic incremental value is set to something other than 1, but I could be mistaken. I suggest you check it out.
Your drill is the drill that will pierce the heavens!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: PxlOn 1,1 works, but not PxlOn X,Y?? (PRIZM BASIC)
« Reply #3 on: February 03, 2014, 09:54:43 pm »
I tried using PxlOn X,1 alone with a 1->X before and no loop and I still got the error. So the issue isn't related to the For loops.

Offline bb010g

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 428
  • Rating: +22/-1
  • I do stuff
    • View Profile
    • elsewhere on the net
Re: PxlOn 1,1 works, but not PxlOn X,Y?? (PRIZM BASIC)
« Reply #4 on: February 03, 2014, 10:57:38 pm »
Running ClrGraph:For 1→X To 1:PxlOn (Int X),(Int X):Next gives a Domain Error; ClrGraph:1→X:PxlOn (Int X),(Int X) works fine.
I made this DISTGRPH a while ago, and it works:
Code: [Select]
?→I:ClrGraph
For 0→J To I
PxlOn Intg (93.5×J÷I+(Intg (Ran# ×187×(I-J)÷I)+1)),Intg (189.5×J÷I+(Intg (Ran# ×379×(I-J)÷I)+1))
Next
(Aside: Why is there a space after Ran#?)
Arch Linux user
Haskell newbie | Warming up to Lua | Being dragged into C++
Calculators: HP 50g, HP 35s, Casio Prizm, TI-Nspire CX CAS, HP 28s, HP Prime, Mathematica 9 (if that counts)
π: 3.14...; l: 108; i: 105; e: 101; l+i+e: 314
THE CAKE IS A LIE IS A PIE

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: PxlOn 1,1 works, but not PxlOn X,Y?? (PRIZM BASIC)
« Reply #5 on: February 04, 2014, 12:28:43 am »
Nope, even if I use something like PxlOn (Int X),(Int Y) or PxlOn (Intg X),(Intg Y) I still get the same error as before.

Your program, on the other hand (the last one in code tag you posted), works fine.
« Last Edit: February 04, 2014, 12:38:04 am by DJ Omnimaga »

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: PxlOn 1,1 works, but not PxlOn X,Y?? (PRIZM BASIC)
« Reply #6 on: February 04, 2014, 08:40:37 am »
Maybe because PxlOn overrides the both variables?

Offline Siapran

  • LV3 Member (Next: 100)
  • ***
  • Posts: 58
  • Rating: +28/-1
  • Space Dwarf
    • View Profile
Re: PxlOn 1,1 works, but not PxlOn X,Y?? (PRIZM BASIC)
« Reply #7 on: February 04, 2014, 10:01:22 am »
Aaah the joys of casio basic, where all the graphic functions use X and Y as global variables.

Actually the use for this override is justified by the function plot:
Code: [Select]
ViewWindow 1, 127, 0, 1, 63, 0
64 -> X
32 -> Y
Plot X, Y [triangle thingy]
Locate 1, 1, X
Locate 2, 1, Y

Using the display instruction on a Plot X, Y function allows the user to move a cursor around the screen and effectively modify the X and Y coordinates (confirmed by pressing EXE)
This is actually very useful for point and click games, or for graphical interfaces (especially on Casio g25 calculators (can't remember the international name), where there weren't any kind of decent Input/Output functions)

Since this function was created before any kind of graphical functions on the latest calculator models, the later functions inherited from this behaviour (just like the SH3 calculators' BASIC graphical screen inherited from the 127*63 resolution of the previous models, despite the physical screen being 128*64)

« Last Edit: February 04, 2014, 10:15:00 am by Siapran »

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: PxlOn 1,1 works, but not PxlOn X,Y?? (PRIZM BASIC)
« Reply #8 on: February 04, 2014, 11:13:50 am »
The graphical screen dimension is odd for the same reason in TI: have a center defined by a pixel and have even space after splitting the screen with the graphic axes

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: PxlOn 1,1 works, but not PxlOn X,Y?? (PRIZM BASIC)
« Reply #9 on: February 04, 2014, 12:05:53 pm »
Aaah the joys of casio basic, where all the graphic functions use X and Y as global variables.

Actually the use for this override is justified by the function plot:
Code: [Select]
ViewWindow 1, 127, 0, 1, 63, 0
64 -> X
32 -> Y
Plot X, Y [triangle thingy]
Locate 1, 1, X
Locate 2, 1, Y

Using the display instruction on a Plot X, Y function allows the user to move a cursor around the screen and effectively modify the X and Y coordinates (confirmed by pressing EXE)
This is actually very useful for point and click games, or for graphical interfaces (especially on Casio g25 calculators (can't remember the international name), where there weren't any kind of decent Input/Output functions)

Since this function was created before any kind of graphical functions on the latest calculator models, the later functions inherited from this behaviour (just like the SH3 calculators' BASIC graphical screen inherited from the 127*63 resolution of the previous models, despite the physical screen being 128*64)


Oh wow, now that you mention it, I just realized that my issue was because I was using X and Y. I tried with different variables and now it works.

The 83+ had a similar issue with Y, but not with X. Since I always thought it was a bug with ClrDraw, I didn't realize a similar issue was present on Casio models.

Anyway thanks for the tip!