Well, the project itself looks pretty great, but that code could certainly use some work! Perhaps you could modify the value in K first by using a sum(cumsum(KEYS)) check, and then adding that value to the offset in the list. Anyway, good luck, and great job!
A little bit of progress tonight; I have it set up to display the names for the quiz up along with the flag. It even will overwrite the text color with red/green based on correct or wrong (sadly, if you're correct, it still fails, need to figure out why)
As it stands right now, I'm tired, and having issue with the code to determine which of the flags to pull from. Something to work on towards the weekend.
On a side note, figured out (rather quickly, once I took a better look at the code) what the issue with detecting correct/wrong is. So that could be fixed, but I need to fix the other bit before I can fully test.
I also reduced the correct/wrong detection from 548 bytes to 219 bytes, so hooray hoorah for that \o/
As it stands right now, I'm tired, and having issue with the code to determine which of the flags to pull from. Something to work on towards the weekend.
On a side note, figured out (rather quickly, once I took a better look at the code) what the issue with detecting correct/wrong is. So that could be fixed, but I need to fix the other bit before I can fully test.
I also reduced the correct/wrong detection from 548 bytes to 219 bytes, so hooray hoorah for that \o/
My current conundrum is this, essentially:
Code:
Essentially, sets up the list with 4 random, non repeating numbers, randomly chooses one of the 4 slots, and sets the value of that slot to A.
The problem I'm having at the moment is getting which appvar I need to look at.
There are 27 flags in each appvar listed, except the last one which didn't fill up yet.
The above code only works with certain numbers, and was causing my issues. I haven't yet figured out the math to make this work properly, and thinking maybe a For( loop may be needed to get the proper value.
Code:
randIntNoRep(1,206,4→˪PDGA
randInt(1,4→T
˪PDGA(T)→A
iPart(A/27→B
"rowSwap(SPRDAT"+sub("3456789A",B,1)→Str0
Essentially, sets up the list with 4 random, non repeating numbers, randomly chooses one of the 4 slots, and sets the value of that slot to A.
The problem I'm having at the moment is getting which appvar I need to look at.
There are 27 flags in each appvar listed, except the last one which didn't fill up yet.
The above code only works with certain numbers, and was causing my issues. I haven't yet figured out the math to make this work properly, and thinking maybe a For( loop may be needed to get the proper value.
I see that you are picking four flags at random to quiz people with and choosing one of them to display (and be the right answer). Your problem is that you're making B be 0-indexed, but strings are 1-indexed. You have two options:
Code:
or
Code:
Code:
1+iPart(A/27→B
"rowSwap(SPRDAT"+sub("3456789A",B,1)→Str0
Code:
iPart(A/27→B
"rowSwap(SPRDAT"+sub("3456789A",B+1,1)→Str0
It's not quite right, it 'turns the page' too early.
Basically:
SPRDAT3 | 1-27 | 1
SPRDAT4 | 28-54 | 2
SPRDAT5 | 55-81 | 3
SPRDAT6 | 82-108 | 4
SPRDAT7 | 109-135 | 5
SPRDAT8 | 136-162 | 6
SPRDAT9 | 163-189 | 7
SPRDATA | 190-216 | 8 (Right now, should cap off at 206)
I wrote this program to do double checking:
Code:
It seems to work, until you make it to 27. Then it goes to the next appvar. It shouldn't change until it hits 28.
Going to do a bit more playing around with this, I think I might have an idea for how to get around this issue.
Edit:
Changed the code to:
Code:
And it seems to work perfectly now. Go me!
Edit 2:
Seems it is indeed telling me the correct flags and linking back to the proper name. I still have the issue of it telling me it's wrong and then saying it is correct. Have to figure out what is up with that.
Thoughts?
Edit 3:
Figured out the issue with it thinking it was wrong when it was correct.
Basically:
SPRDAT3 | 1-27 | 1
SPRDAT4 | 28-54 | 2
SPRDAT5 | 55-81 | 3
SPRDAT6 | 82-108 | 4
SPRDAT7 | 109-135 | 5
SPRDAT8 | 136-162 | 6
SPRDAT9 | 163-189 | 7
SPRDATA | 190-216 | 8 (Right now, should cap off at 206)
I wrote this program to do double checking:
Code:
ClrHome
1->A:1->W
While W=1
getKey->K
A-1((K=24 and A>1)-(K=26 and A<206->A
1+iPart(A/27->B
Output(1,1,"A
Output(1,5,A
Output(2,1,"B
Output(2,5,B
End
It seems to work, until you make it to 27. Then it goes to the next appvar. It shouldn't change until it hits 28.
Going to do a bit more playing around with this, I think I might have an idea for how to get around this issue.
Edit:
Changed the code to:
Code:
ClrHome
1->A:1->W
While W=1
getKey->K
A-1((K=24 and A>1)-(K=26 and A<206->A
1+iPart(A/27->B
If fPart(A/27)=0:B-1->B
Output(1,1,"A
Output(1,5,A
Output(2,1,"B
Output(2,5,B
End
And it seems to work perfectly now. Go me!
Edit 2:
Seems it is indeed telling me the correct flags and linking back to the proper name. I still have the issue of it telling me it's wrong and then saying it is correct. Have to figure out what is up with that.
Thoughts?
Edit 3:
Figured out the issue with it thinking it was wrong when it was correct.
This looks great! I had a post half-drafted about how to fix that remaining off-by-one error, but I see you came up with a solution on your own. Tiny pair of suggestions in an otherwise flawless-looking quiz system:
1) I recommend putting the "Wrong:" and wrong count on the other side of the screen; it looks squished to the left as-is to me.
2) I would like the flags themselves higher and the top of the "flag pole" even with the top of the flag, or at most a few pixels higher.
1) I recommend putting the "Wrong:" and wrong count on the other side of the screen; it looks squished to the left as-is to me.
2) I would like the flags themselves higher and the top of the "flag pole" even with the top of the flag, or at most a few pixels higher.
Thanks!
As for 1, My only issue is the fact that the numbers, as they gain digits, move toward the right, so I'd need a way to accommodate that, make the digits move left as they gained values, hence why I went with both on the left, makes it easier coding wise.
2) Yeah, I'm not 100% happy with placement either, that was something I was going to adjust later. I also wanted to move the flag poles up (There are 2, only the other one shows up for 3 flags, on the other side of the flag). So expect changes with that once I get back to working on this
Should I do some form of high score system?
As for 1, My only issue is the fact that the numbers, as they gain digits, move toward the right, so I'd need a way to accommodate that, make the digits move left as they gained values, hence why I went with both on the left, makes it easier coding wise.
2) Yeah, I'm not 100% happy with placement either, that was something I was going to adjust later. I also wanted to move the flag poles up (There are 2, only the other one shows up for 3 flags, on the other side of the flag). So expect changes with that once I get back to working on this
Should I do some form of high score system?
I'd say a high score system isn't 100% necessary, but it helps the replay value of the program, I believe. Also, regarding right-aligning those numbers, the following code will right-align a non-negative integer on the graphscreen, assuming 8-pixel-wide number characters, a right edge R, and a value to display X:
Code:
Code:
Text(Y,R-8max(1,int(log(10X+.01))),X
I could take the high scores and put them on the right side of the screen, that way they stay static and nothing has to change for the other. I might go with that and see how it looks.
I think I saw "Gamia" pop up as one of the options in your quiz mode. I believe that should be "Gambia"?
Highly possible! :p My keyboard isn't the best, it misses keystrokes, and there were 206 names, so there may be a few errors.
KermMartian wrote:
2) I would like the flags themselves higher and the top of the "flag pole" even with the top of the flag, or at most a few pixels higher.
This better?
Much better, thanks for showing your progress on that. I think that makes it significantly clearer that that is a flagpole.
Update for the day
Shows off the scoring, high score display, getting correct and wrong answers, and what the main menu looks like at present. Not sure if I need a 'Wrong!' message or not for when the answer is incorrect. Or if I even really need the 'Correct!' message :p What do you all think?
Shows off the scoring, high score display, getting correct and wrong answers, and what the main menu looks like at present. Not sure if I need a 'Wrong!' message or not for when the answer is incorrect. Or if I even really need the 'Correct!' message :p What do you all think?
I think you need both the Correct! and Wrong! messages. I am confused why there is 3, 6, and 9 under High score;what am I missing there? Also, may I recommend a 1-pixel border around the flags for when the flag includes white?
KermMartian wrote:
I think you need both the Correct! and Wrong! messages. I am confused why there is 3, 6, and 9 under High score;what am I missing there? Also, may I recommend a 1-pixel border around the flags for when the flag includes white?
I've been debating the lines around the flag, I'll probably give that a go ahead and knock that out.
And those are the high score values to the right. It's only updated once the current_correct > saved_correct.
Ohh, so are those the top three high scores? Or are they in fact what ordelore said? If the former, I'd put them closer together and add 1./2./3. in front.
No, If say one game you get 3 correct and quit, then the next game, you get 4 correct, it overwrites all the values because you got the most correct, it doesn't care how many rounds or how many wrong. It's essentially bragging rights, because you only care how many you get correct in X amount of rounds.
And I put them in this manner so they'd mirror the other side a bit and use up some of the room to the right so it doesn't look so empty on the right side corner, and it helps show what each score goes with.
Edit:
3 votes on Omnimaga saying that the coloring of the text is enough to show correct and failure, vs Kerm's opinion on needing the text. Anyone else with opinions on this?
And I put them in this manner so they'd mirror the other side a bit and use up some of the room to the right so it doesn't look so empty on the right side corner, and it helps show what each score goes with.
Edit:
3 votes on Omnimaga saying that the coloring of the text is enough to show correct and failure, vs Kerm's opinion on needing the text. Anyone else with opinions on this?
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
» Go to Registration page
» Goto page Previous 1, 2, 3, 4 Next
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 2 of 4
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement