Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Conditional operator?
#8
(10-30-2021, 05:57 PM)boriel Wrote: Can you explain further, please?
What does not work? Are you compiling with —sinclair or —strict-bool options?
If not, try it and let me know.

I thought Sinclair option just involved the ATTR, SCREEN$ and POINT features.

I discovered this compiler some days ago and to me it's superb.

However, I've tested the following program and results aren't as I expected (I compiled it with ZX Basic 1.16.0):

Code:
10 let n = 2
20 let n = (n+1) AND n<3
30 print n
100 let n = 20
200 let n = (n+1) AND n<3
300 print n

These are:
With Fuse emulator, a Spectrum +2 prints:
3
0

With Zx Basic and Sinclair option enabled, the Spectrum prints:
1
0

With Zx Basic and strict boolean option enabled, the Spectrum prints:
1
0

With Zx Basic and both Sinclair and strict boolean options enabled, the Spectrum prints:
1
0


Now I've realized that my python version is 3.6.9. Could this be the problem?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)