For those that don't know what abba caving is, you should refer to this topic here.

Anyways, after each game of abba caving, we always bounce around and waste time trying to verify how many points each person has gotten.

I've decided to write up a program that will help speed up this issue, currently on the CE. Which of course means immediate backwards compatibility with the CSE. Smile



I have ideas on how I want the input interface to be for telling the calc how many of each item is present. It will also store the list into Archive and recall it each time the program is run, so you don't always have to reconfigure the values. That's essentially the setup for first time run.

I plan to port this to all the z80 TI calculators, for fun. And because, why not?

Code currently sits at 800 bytes, and now clears the screen out below the title to make room for the main menu.
Little bit of an update, I've nearly gotten the ore counting bit done, and it figures in the scores as it loops through the ore types. I also have it set up to run against the dungeon artifacts, but so far it isn't 100% completed. I still also need to add in the totals screen. Plus I still need to add in the surprise function that hasn't been mentioned yet. Smile

Project is sitting around 1800 bytes. I have places that need cleaning up, mostly identifiers for the Ends. Might do that in Tokens once the program is 'completed'.
Latest progress:

This now counts all ores based on scores, ignores any ores that has a score value of 0, and tallies up the values after you input all the amounts of each item. At most, you can say you have 36 stacks of any ore, or 36 dungeon items. For ores, you input stacks and how many loose, which is 0-63.



If you watch, first screenshot shows first time running the program. Second one shows running it again. Second shot shows off changing the points for some of the items, and you'll notice that when I go to enter the scores, it ignores the ones with a value of 0.

Also, because I want to keep an online backup of my code as it is now:


Code:
ClrDraw:AxesOff
BackgroundOff
1→W
While iPart(W)=1
TextColor(BLACK
Text(⁻1,0,60,"ABBA CAVING
Text(⁻1,20,67,"CALCULATOR
SetUpEditor ʟABBA
"          "→Str5
For(F,1,21
Str5+"          "→Str5
End
If dim(ʟABBA)=0 or W=1.3:Then
If dim(ʟABBA)=0:{0,1,1,4,9,10,10,15→ʟABBA
Text(43,87,"SET VALUES:
Text(55,0,"COAL ORE:
TextColor(ORANGE
Text(67,0,"IRON ORE:
TextColor(RED
Text(79,0,"REDSTONE ORE:
TextColor(YELLOW
Text(91,0,"GOLD ORE:
TextColor(BLUE
Text(103,0,"LAPIS ORE:
TextColor(LTBLUE
Text(115,0,"DIAMOND ORE:
TextColor(GREEN
Text(127,0,"EMERALD ORE:
TextColor(BLACK
Text(139,0,"DUNGEON ARTIFACTS:
For(F,1,8
Text(43+F(12),170,ʟABBA(F
End
2→W:55→C
While W=2
Text(C,160,"<
Text(C,190,">
Text(C,170,ʟABBA(iPart(C/12)-3
getKey→K
If K=25 or K=34:Then
Text(C,160,"     
Text(C,190,"     
End
If K=24 or K=26
Text(C,170,"         
C-12((C>43 and K=25)-(C<151 and K=34→C
If C=43:139→C
If C=151:55→C
iPart(C/12)-3→D
ʟABBA(D)+.5(ʟABBA(D)<5 and K=26)+1(ʟABBA(D)≥5 and K=26 and ʟABBA(D)<15)-.5(ʟABBA(D)≤5 and K=24 and ʟABBA(D)>0)-1(K=24 and ʟABBA(D)>5→ʟABBA(D
If K=21 or K=105:Then
For(F,43,139,12
Text(F,0,Str5
End:1.6→W:End
End
End
1.6→W
If W=1.6:Then
80→C
Text(80,70,"RUN CALCULATION
Text(92,70,"CONFIGURE SCORES
Text(104,70,"GAME TIMER
Text(116,70,"EXIT PROGRAM
3→W
While W=3
Text(C,60,">
getKey→K
If K:Text(C,60,"   
C-12((K=25 and C>68)-(K=34 and C<128→C
If C=128:80→C
If C=68:116→C
If K=21 or K=105:Then
If C=92:Then
For(F,80,116,12
Text(F,0,Str5
End
1.3→W
End
If C=116:DelVar W
If C=104:6→W
If C=80:5→W
End:"21105
End:"3
End:"1.6

If W=6:Then
"TIMER
End:"6

If W=5:Then
{0,0,0,0,0,0,0,0→ʟTMP
For(F,80,116,12
Text(F,0,Str5
End
0→F
For(F,0,6
0→A:0→B:97→C
If ʟABBA(F+1)>0:Then
sub("COAL    IRON    REDSTONEGOLD    LAPIS   DIAMOND EMERALD ",1+F(8),8→Str6
Text(55,110,"ORE:
Text(67,110,Str6
Text(85,75,"X64:
Text(127,75,"<64:
6→W
While W=6
Text(97,85,A
Text(139,85,B
If (A>0 and C=97) or (B>0 and C=139
Text(C,75,"<
If (A<36 and C=97) or (B<63 and C=139
Text(C,105,">
getKey→K
If K:Then
Text(C,75,"     
Text(C,105,"     
End
C-42((K=25 and C>97)-(K=34 and C<139→C
If C=97 and K:Text(97,85,"         
If C=139 and K:Text(139,85,"         
A-1((A>0 and K=24 and C=97)-(A<36 and K=26 and C=97→A
B-1((B>0 and K=24 and C=139)-(B<63 and K=26 and C=139→B
If K=21 or K=105:Then
(A(64))(ʟABBA(F+1))+B(ʟABBA(F+1)→ʟTMP(F+1
5→W
Text(67,0,Str5
Text(97,0,Str5
Text(139,85,"           
End
End:"6
End:"If
End:"For(
For(F,55,139,12
Text(F,0,Str5
End
If ʟABBA(8)>0:Then
DelVar A
Text(100,70,"DUNGEON
Text(112,60,"ARTIFACTS
Text(127,75,"≤36
8→W
While W=8
Text(139,85,A
If A>0:Text(139,75,"<
If A<36:Text(139,105,">
getKey→K
If K:Text(139,85,"         
A-1((K=24 and A>0)-(K=26 and A<36→A

If K=21 or K=105:Then
A(ʟABBA(8)→ʟTMP(8
For(F,100,151,12
Text(F,0,Str5
End
9→W
End
End:"8
End:"If
End:"5
If W=9:Then
Text(40,75,"TOTALS:
52→C
For(F,0,7
TextColor(BLACK
Text(C,0,sub("COAL    IRON    REDSTONEGOLD    LAPIS   DIAMOND EMERALD DUNGEON ",1+F8,8
TextColor(BLUE
Text(C,85,"+ ",ʟTMP(F+1
C+12→C
End
TextColor(BLACK
Text(150,0,"TOTAL:
TextColor(RED
Text(150,90,sum(ʟTMP
Repeat getKey
End
TextColor(BLACK
For(F,40,150,12
Text(F,0,Str5
End
1→W
End:"9

End:"W=1
DelVar Str5DelVar ʟTMP
Archive ʟABBA
ClrDraw:ClrHome
Disp


This is, in no way, my final version. Please don't offer suggestions to things, as I still have more to add and a lot of clean up to do. Thanks.
Very cool! I bet this makes things waaaaay easier when counting, though I wouldn't know, as I can never get on when you guys are playing a round. Razz
You should definitely find a way to get in on an event.

I'm running into problems writing up a count down timer, and it's bothering me. I can easily deal with the minutes aspect (got the code for that to work no problem) but I can't seem to get the 60 seconds aspect to work properly.

I'm still fighting with it, hopefully I'll have something soon. I want to set it up so it's all set up in one loop to determine how many minutes to run the event, and start/cancel the timer while the clock is in progress.

Any thoughts on the screenshots?


Code:
StartTmr->T
900->U:1->W
While W=1
Text(-1,20,20,iPart((U-checkTmr(T))/60

End


The Text( line there gives the minutes. I've tried going with a few variations for the seconds, but have not been successful on making it work. Thought I'd post the code in case someone else might want to offer up ideas on it.
I like that you give people the option to enter how many stacks and how many remaining blocks of each ore they have, rather than needing to compute 3*64 and hit an arrow key 192 times. The screenshots look great to me, and other than not knowing what the timer will look like, I see nothing I'd suggest changing in the screenshots. I know that I'll want to use this tool the next time we Abba Cave on the Cemetech Minecraft server, for sure.
Need some help, guys. The following code isn't updating properly, and I'm not sure why.


Code:
900->U:1->W
startTmr->T
While W=1
checkTmr(T
Text(-1,20,20,iPart((U-Ans)/60)," : ",(U-(iPart((U-Ans)/60)60
End


I know the last part of the Text( probably isn't completely correct. I've been struggling to get the seconds to display properly while messing with this. I've tried this in a For( loop and a Repeat loop, with the same results. Need the While loop because of the way I plan to set this up.

Things do finally update to 13 : 120 at some point, took a while to get there.

Any help resolving this aspect would be greatly appreciated.
Try this:

Code:
Text(~1,20,20,iPart((U-Ans)/60)," : ",60fPart((U-Ans)/60

or if you have a color calc:

Code:
Text(~1,20,20,int((U-Ans)/60)," : ",remainder(U-Ans,60
That works much better, and now it actually updates. I run into a problem at some point that seconds has 3 digits, I have no idea exactly when that happens, though. Going to do some more playing around with it when I have some time. (This is more a note to self than anything, so I remember what I need to adjust.)

Thanks for the help. Smile
That is easy: you don't erase the numbers, so when going down from 10 to 9, the 1 will be overwritten, but not the 0, so it looks like 90 or so. You can display some extra spaces to erase them.
*bump* How's this going, tifreak? Did you repair the problem with three digits appearing, or does it still exist?
Apparently, it's not generating a 3 digit spot. It's the fact I'm using a single Text(, it shifts over to the left. Going to mess with the Text commands, make it so things shift around properly.
Honestly, this was the hard part of the timer, thanks to PT_ for helping me fix my issue with showing seconds.



The first bit counting from 10 minutes, where it goes to Time!, that's because I hit the cancel button. Just want that to be clear before someone makes mention of it :p Next part is to get this beastie to adjust how much time you want for a match (thinking setting default to 30 minutes, adjusting by 5 minutes (maybe?) down to 15 minutes and up to 1 hour.

Thoughts on the times?
Those sound like very reasonable bounds. Why have limits at all, though? Would it be harder to make it increments of 5 minutes, but down to 5 minutes and up to (whatever)? I suppose the most difficult part there would be erasing hours, but you'd have to do that for 1 hour anyway.
Well, for 1 hour, it will show 60 minutes, before counting to 59 : 59, so hour is irrelevant.

Anything less than 15 minutes for a match is just silly, there wouldn't be time to do anything. Anything over an hour, well.. I dunno, is there any reason to have a match longer than an hour?
Well, since no one has offered up a counter argument on this, 60 minutes will be the max time, and will be integrated into the overall program! This will entail mostly adding in the clearing function, and placing text so it looks nice to describe what you are doing at any given time.


So, overall, the program works and is functional. I've done some cleaning up of the code, could probably do a little more but I'm not truly sure it's worth the effort. Going to share with the one person that I know will be able to at least understand how to use it, see if it works for him, and release Very Happy
A couple of comments on this:
1) I couldn't figure out how to quit from the score configuration screen. [CLEAR] or [MODE] to immediately quit from that would be helpful (and obviously if it's the first run, it's fine it that does or does not reappear the next time I run the program). I eventually pressed [2nd], but I'm not sure if that's supposed to be Quit or Apply. I'd say it's confusing for Quit.
2) On the Set Timer screen, add units (minutes) after the number.
3) Cancel after starting the timer makes the timer end, but doesn't quit from the timer mode. Is that intentional?

Other than that, great job! I look forward to seeing this gain wider usage.
2nd is mostly a confirm button, the readme is going to be far more comprehensive for the final. I wasn't sure where to put that on screen, since there isn't overly larges amounts of room with all I put up there.

Not really sure what you mean in regarding adding the units after the number?

The way I have it set up, pressing cancel or running out of time goes to the same routine, to save space.
As per recommendations, I've added in the : 00 behind the minute selector, and I've added some helpful instructions when starting the program.

  
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
Page 1 of 3
» 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

 

Advertisement