I'm currently working on a TI-Basic Wordle program in which one player enters a word for the other to guess. The program uses Celtic-CE commands, so it won't work if you don't have it installed. (Download it here: bit.ly/CelticCE)
The program is nearly complete. There's one bug that I need to sort out; not sure how long that'll take, but I have plenty of class time to iron it out.
I'll post the program here when it's complete.
Cool I wish I could do that I’m not good at programming
(I moved this to the more appropriate subforum for projects like this)
How did you choose to implement multiplayer? Is it between two calculators, or on one shared device? Also, I'd love to see screenshots!
@iPhoenix One shared device. I wish I could make it between two calculators, but that's far, far above my pay grade. As for screenshots, turns out the bug is pretty significant. The problem is, if the word is, for example, "slash," and you guess "sassy," the middle S will appear orange (it's supposed to be gray).
I'll post screenshots as soon as possible.
@Calcgamer696969 Thanks! As with anything, you can improve with a bit of practice. It's worth it!
I fixed the bug that I found in the program and am uploading the updated version now
I noticed a few memory leaks when Goto-ing and SetParseLine-ing out of loops and if:thens, but overall, really good program!
Edit: Also, I would recommend that instead of having two different programs, you should just add a setting to toggle the extra [stat] key functionality.
pi644721 wrote:
I noticed a few memory leaks when Goto-ing and SetParseLine-ing out of loops and if:thens, but overall, really good program!
Hi! I really appreciate the feedback. Could you please be more specific about the memory leaks? I'd love to know how I can improve. Thank you!
Well, turns out there's only one (on line 15)
Code: Lbl 0:ClrHome
Disp "Player "+toString(X
Input "Five-letter word:",Str1
If 5!=length(Str1:Then
Pause "Invalid. Retry
Goto 0 //This causes a memory leak when jumping out of the If:Then because the End statement is never reached
End
I think this would be better structured with a Repeat loop that exits when the correct amount of characters are entered.
Edit: I would also recommend that you add the check to make sure that the word is made of valid characters inside the Repeat loop because that eliminates another memory leak and puts all of the word checking in one place.
I updated it to this:
If 5=length(Str1:det(79,16
Pause "Invalid. Retry
Goto 0
Question: Exactly what problems do memory leaks cause? The program seemed to work well before.
Memory leaks just eat up RAM, and will consequently give a memory error if done too many times.
Cars and Ice Cream wrote:
I updated it to this:
If 5=length(Str1:det(79,16
Pause "Invalid. Retry
Goto 0
Question: Exactly what problems do memory leaks cause? The program seemed to work well before.
A memory leak is when a portion of a computer's memory becomes inaccessible. If you leak memory in a loop, you'll eventually run out. In TI-BASIC, until that happens, it's not possible to tell that a memory leak is happening.
Memory leaked by Gotoing out of a control flow block becomes accessible again after the program stops running, so in this case it's not the end of the world, as long as the user enters a valid string within a reasonable number of tries.
The underlying issue that causes Goto to leak memory can also cause some extremely unintuitive and hard-to-debug behavior if you later (for example) wrap your code in a For( loop, so it's best practice to just avoid using Goto from a control flow block to a Lbl outside of that block.
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
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