You are browsing as a guest. Sign up (or log in) to start making projects!

10h 30m 10s logged

I Guess I Fixed It???? IDeK Tbh…

What has been done?

  • Created a sorting function that iterates throughout a csv-list using a “shell sorting” (nesting) method (inspired by the YouTube short: https://youtu.be/RDFGkBE2O50?si=yXnJloCW18_o94bB ).
  • Created the visual display of the leaderboard for the terminal game (using the body_text() helper function that I made earlier.
  • Started to try to create a function that takes the integer values that are to be displayed on the leaderboard, and inserts in commas where appropriate:
def format_numbers_2(orig):
    string = str(orig)
    split_curr = list(string)
    split_check = list(string)
    while len(split_curr) > 3:
        split_curr = split_curr[:-3]
        split_check.insert(-3,",")
    return "".join(split_check) 

Which only works some of the time…
(It still needs a lot of work…)

Honestly, I have been strugling with this function, but I think the issue with why I have been unable to get it to work correctly, is because I have not been planning enough around the logic beforehand (Which is my aim going forward).

So, what’s next?

Pretty much just getting this comma function working, so that the leaderboard display doesn’t look like this!

----------- Welcome, Test User -----------
Cash Leaderboard:
1. four - $21212314.0
2. hill - $5040.0
3. ardangeorge - $5000.0
4. test - $2323.0
5. Ardan George - $502.06
------------------------------------------

Anyway, thanks for reading!
(And don’t forget to say Hi to BongoCat! :bongoblobcat: )
-Ta!

0
15

Comments 0

No comments yet. Be the first!