Jump to content

Through the Living Wrath

Members
  • Posts

    7008
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by Through the Living Wrath

  1. I know Java (might be rusty) and Python. I can read/search for errors in C, but never coded it.
  2. Very sick

    very ow

    @CoderDrag0n8

    past chapter 40

    1. CoderDrag0n8

      CoderDrag0n8

      YAY

      not yay to the sick part, i hope you get better, but YAY to to past chapter 40 part

  3. @KaladinsSenseOfHumorSpren
  4. There is bugs lemme fix em rq
  5. Penalty: Wrong suit.
  6. Okay! Im ready to start. I made some code to automate the deck cuz im cool. It's in my blog. The order of play will be: @CoderDrag0n8 @The Great Wyver @Kansas Stormcursed @KaladinsSenseOfHumorSpren The top of the discard is a 2 of Hearts.
  7. Through the Living Wrath

    Deck

    import random global cards global suit global discards global game cards = list(range(1, 53)) discards = [] suit = ["Clubs", "Diamonds", "Hearts", "Spades"] game = True # Place card in Discard def drawtodiscard(): global suit top = (drawCard()).split() specifiedsuit = suit.index(top[2]) discard(int(top[0])+(13*specifiedsuit)) def discard(card): global discards discards.append(card) # Checks if the deck needs shuffling. (Every slot is empty, equal to -1) def checkShuffle(): global cards for i in cards: if i != -1: return False return True # Draws a card from the deck, sets card slot empty def drawCard(): global cards global suit select = -1 while select == -1: card = int(random.random()*52) select = cards[card] cards[card] = -1 # Turns out 13 mod 13 is 0, not 13 if select % 13 != 0: print(f"{select % 13} of {suit[int(select/13)]}") return(f"{select % 13} of {suit[int(select/13)]}") else: print(f"13 of {suit[int(card/13)]}") return(f"13 of {suit[int(card/13)]}") # Shuffle the deck def shuffle(): global game global cards global discards if discards != []: for i in discards: cards[i-1] = i discards = [] else: print("Discard is empty. Reseting Game.") game = 0 return(True) # Main loop while (game): prompt = "\nActions:\n -Input a positive integer to draw that many cards.\n -Input the name of a card, formatted '(Number) of (Suit)', to discard it.\n -Type 'Draw to Discard' to flip over top card of deck\n -Type Save /path/to/save/file to save\n -Type Import /path/to/save/file to load a deck\n -Type Reset /path/to/save/file to reset deck and file\n\n" action = input(prompt).rstrip() # Determines the action by trying to convert it to an integer. If it fails, then keeps action as a string. draw = True try: action = int(action) except ValueError: draw = False if draw: for i in range(action): drawCard() if checkShuffle(): if shuffle(): cards = list(range(1, 53)) discards = [] suit = ["Clubs", "Diamonds", "Hearts", "Spades"] game = True break elif action == "Draw to Discard": drawtodiscard() # Check Command or Discard. The commands - "if parselist[0] ==..." take files given to them and writes deck and discard to them, or reads deck and discard from them. elif action != "" and action.split()[-1] != action.split()[0]: parselist = action.split() if parselist[0] == "Save": try: save = open(parselist[1], "w") save.write(" ".join(map(str, cards)) + "\n" + " ".join(map(str, discards))) save.close() except: print("Error Opening File") elif parselist[0] == "Import": try: save = open(parselist[1], "r") files = save.read().rstrip().split("\n") cards = list(map(int, files[0].split(" "))) discards = list(map(int, files[1].split(" "))) save.close() except: print("Error Opening File") elif parselist[0] == "Reset": try: cards = list(range(1, 53)) discards = [] save = open(parselist[1], "w") save.write(" ".join(map(str, cards)) + "\n" + " ".join(map(str, discards))) save.close() except: print("Error Opening File") else: # Parse what should be a discard valid = True try: specifiedsuit = suit.index(parselist[2]) except: valid = False if parselist[0].lower() == "a": parselist[0] = 1 if parselist[0].lower() == "j": parselist[0] = 11 if parselist[0].lower() == "q": parselist[0] = 12 if parselist[0].lower() == "k": parselist[0] = 13 try: num = int(action[0]) except ValueError: valid = False if valid: discard(num+(13*specifiedsuit)) else: print("Invalid Input") else: print("Invalid Input") This is python code I did give it to some friends to use in a project they're doing....
  8. Okay guys

    i know I said Mao would start soon

    but I decided to make a program that would make it much easier for me to deal

    And imma put that program here when I’m done.

    1. Through the Living Wrath

      Through the Living Wrath

      It’s almost done, I’m bug testing now.

  9. “Well, there might be people who know. Someone stole it. It was… it was a dead person. You might ask them.” He appeared near @NameIess, @Hawks, and @Sherma Main. ”That one!” She pointed to Asher (Hawks) Note that yall can’t see or hear whoever is talking to Kino.
  10. eh nah. Spoilers work just fine, cuz like theres not even any advantage to knowing the other peoples decks
  11. Cool! I’ll start the game in a bit, but im deathly ill
  12. My teacher is a psychopath she prefers we do excellent on the AP test and then to achieve that stresses us with rushed, very harshly graded assignments than to accept that some people might do poorly and respect our personal lives and time
  13. In the beginning, 4
  14. The game has not yet started you playing?
  15. We need at least 4 players to start a game, so…
  16. I’ve been doing well! There was a time Two or three days ago where I was very very stressed and sleep deprived and AP seminar is still *shiver* But I’ve been doing well
  17. @Kansas Stormcursed @Born of Mist @Spark of Hope The Still Wind looked up, frowning. “Come on. We gotta get you to shelter.” Mystic Syn
  18. [But I’m code! The only viruses I can get are are digital!]
  19. GM run (Imagine this next part in a cheesy education voice) But I really try to actualize the ideas and dreams and plots of your characters.
×
×
  • Create New...