deckstats.net
You need to be logged in to do this.
The buttons above will open in a new window. Please return to this window after you have logged in. When you have logged in, click the Session aktualisieren button and then try again.

Autor Thema: Programming MTG Stuff Questions (Need Suggestions)  (Gelesen 1795 mal)

WizardSpartan

  • Hero Member
  • *****
  • Beiträge: 1502
  • Karma: 847
  • Red_Wyrm's boo
  • Decks
Programming MTG Stuff Questions (Need Suggestions)
« am: Dezember 12, 2019, 03:15:13 Vormittag »
So I have to do a project for my Computer Science class (in Python). I'm not too advanced, so certain things are above my level.

I was originally considering creating a program that allows a user to input an amount of colored mana symbols and the program will output the number of mana sources necessary to hit that card on curve ≥90% of the time, but it would be a little more than I can handle right now.

I don't want to be told how to do something, I just want ideas. You don't have to be able to code to make suggestions.

I appreciate any ideas I get, even if I decide against them. They may spark an idea of my own. Thanks!

CleanBelwas

  • Hero Member
  • *****
  • Beiträge: 923
  • Karma: 909
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #1 am: Dezember 12, 2019, 10:08:06 Vormittag »
Hey man,

How about something similar to the starting hand tool here on deckstats?

For a given deck list, you create a script that shuffles the deck, deals 7 and lets you add cards to your hand and "play" them (remove them from the list / mark them as played).

MagicMarty

  • New Member
  • *
  • Beiträge: 17
  • Karma: 30
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #2 am: Dezember 12, 2019, 02:12:48 Nachmittag »
I agree with CleanBelwas, i would start with that and then expand when you are ready for it.
Specialy with starting programming start small and devide the problems.

- Make a deck
- Make cards with unique values, Creature / Spells / Lands
- Make a Hand
- Make a Graveyard
- Make a PlayingField

- Then i would go with some things to simulate tutors like show all Spells or with certain conditions

- Mana values, displaying triggers like a message when you play a creature.

TLDR : Start with the basic needs and then add fun stuff!

WizardSpartan

  • Hero Member
  • *****
  • Beiträge: 1502
  • Karma: 847
  • Red_Wyrm's boo
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #3 am: Dezember 12, 2019, 02:32:59 Nachmittag »
Hmm I like the starting hand idea. I'll have to learn a couple things for it, but hopefully it won't be too bad. and MagicMarty, I like the idea to expand on it. I probably won't do it yet, but when I have time (like over a break) or maybe for my final project at the end of the year, I will start adding functionalities. I'll probably start with just inputting a list of cards, then having the program shuffle and output a sample hand.

CleanBelwas

  • Hero Member
  • *****
  • Beiträge: 923
  • Karma: 909
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #4 am: Dezember 12, 2019, 02:56:02 Nachmittag »
Hmm I like the starting hand idea. I'll have to learn a couple things for it, but hopefully it won't be too bad.

Hey man. That's what I was hoping for. I actually built this exact thing myself when I first got into Python and found it to be a decent lesson in the language (though this was a few years ago now). Covers a lot of basic but important functionality and has the potential to be expanded with more complex stuff as things progress.

Good luck man! I hope it all goes well for you. Please keep us updated. I'd love to hear how you get on with it.

MagicMarty

  • New Member
  • *
  • Beiträge: 17
  • Karma: 30
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #5 am: Dezember 12, 2019, 04:05:40 Nachmittag »
Good luck!, and if you get stuck dont be afraid to ask!

WizardSpartan

  • Hero Member
  • *****
  • Beiträge: 1502
  • Karma: 847
  • Red_Wyrm's boo
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #6 am: Dezember 12, 2019, 05:24:02 Nachmittag »
I think I'm gonna put this on the back burner because it's due next Wednesday and I have finals in other classes. I have to figure out something more simple. If I have a lot of time over break, I might start it for fun, though. :l

Aetherium Slinky

  • Hero Member
  • *****
  • Beiträge: 1120
  • Karma: 762
  • Rules Advisor
    • reddit.com/r/jankEDH
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #7 am: Dezember 12, 2019, 06:28:46 Nachmittag »
How about you chuck a bunch of cards at the algorithm and it figures out the bell curve that best fits the mana curve? Exclude lands in the program, obviously.
Come brew some jank with us!
https://www.reddit.com/r/jankEDH/

WizardSpartan

  • Hero Member
  • *****
  • Beiträge: 1502
  • Karma: 847
  • Red_Wyrm's boo
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #8 am: Dezember 13, 2019, 04:25:36 Nachmittag »
Hmm interesting. Problem is i would have to somehow import the cmc of every spell in the game.

CleanBelwas

  • Hero Member
  • *****
  • Beiträge: 923
  • Karma: 909
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #9 am: Dezember 13, 2019, 04:37:14 Nachmittag »
Not necessarily. There are some pretty decent MTG APIs out there if you are able to make use of them. Scryfall has one, and https://magicthegathering.io/ is pretty good too.

Judaspriester

  • Hero Member
  • *****
  • Beiträge: 1523
  • Karma: 500
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #10 am: Dezember 13, 2019, 09:27:39 Nachmittag »
Hmm.. I really like the starting hand stuff. But if you say you don't have that much time, lets break it down a little.
First of all, forget about a fancy interface and such, start on the console.
Then I would suggest to build a program, that reads a given deck list (just a simple txt file), writes them into an array (preferable each card n times, there n is the amount of the given card), shuffle it (I'm kinda sure you don't need to write an algorithm by your own for start) and print the first 7 items of your array afterwards.

This should be doable even with a limited amount of time. After you've got this basic construct, you can add future functions, like a simple user interaction for drawing another card or shuffling again.

In general, if you want to learn programming, start on the console. first learn how to make stuff work, then learn how to make them look pretty. ;)
If you're starting with the UI, you'll usually spend alot of time designing it and moving stuff pixel wise, in stead of doing the real work. That's at least my experience.
You say Prison Cell, I hear 'Holiday'.

WizardSpartan

  • Hero Member
  • *****
  • Beiträge: 1502
  • Karma: 847
  • Red_Wyrm's boo
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #11 am: Dezember 14, 2019, 07:49:40 Nachmittag »
Anybody want to give me a basic explanation of what an API is and how to implement it? I looked it up online, but the technical explanations I encountered went a good bit over my head.

In the future, I will follow a similar series of steps to what you suggested Judaspriester, but I went ahead and threw together an easy Rock, Paper, Scissors game (https://repl.it/@WizardSpartan/Rock-Paper-Scissors) so I could finish the assignment quickly and study for midterms. I might give it a try this weekend, though.

Red_Wyrm

  • Hero Member
  • *****
  • Beiträge: 785
  • Karma: 170
  • I'm the boss of the forums.
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #12 am: Dezember 14, 2019, 08:08:59 Nachmittag »
Anybody want to give me a basic explanation of what an API is and how to implement it? I looked it up online, but the technical explanations I encountered went a good bit over my head.

In the future, I will follow a similar series of steps to what you suggested Judaspriester, but I went ahead and threw together an easy Rock, Paper, Scissors game (https://repl.it/@WizardSpartan/Rock-Paper-Scissors) so I could finish the assignment quickly and study for midterms. I might give it a try this weekend, though.

I, too, did a quick google search to see what it meant. You aren't wrong, the technical explanation is r/woosh. Are you familar with game engines? That is what I thought of when reading the definiton. It is like the governing set of laws that are programmed into the base game.

Perhaps another (hopefully correct) example is the libraries you use in C++ or Python, how you have to download the appropriate  library and then specify that you are using it in the code of whatever program you are writing.

I feel like that is what it is, but I have 0 educational background in computer science. Just what I've taught myself and picked up on my own, which isn't much. Although I do have to use latex for school.
My King Baby said yes!
I thought you'd never ask
Also, I always spell your name correctly, Red_Wurm.  :)

Please, it is Red

MagicMarty

  • New Member
  • *
  • Beiträge: 17
  • Karma: 30
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #13 am: Dezember 14, 2019, 08:30:46 Nachmittag »
To put it in comparable terms it is like a Door that allows you to get data or call upon functions from other pieces of code,
For example Statistics and userprofiles from a game like overwatch can be fetched from blizzards overwatch API
https://www.overbuff.com/ is an example of code using API they use these API calls to safely give you the needed data instead of giving you a direct link (Wich is wildly unsafe).
Just like that you can perhaps get an API that gets Card Info from like Scryfall or something
API stands for Application Programming Interface

https://www.youtube.com/watch?v=cpRcK4GS068

https://scryfall.com/docs/api Perhaps this is worth a read 2, would be a fun way to learn about it :)

Marty out!
« Letzte Änderung: Dezember 14, 2019, 08:33:23 Nachmittag von MagicMarty »

WizardSpartan

  • Hero Member
  • *****
  • Beiträge: 1502
  • Karma: 847
  • Red_Wyrm's boo
  • Decks
Re: Programming MTG Stuff Questions (Need Suggestions)
« Antwort #14 am: Dezember 14, 2019, 08:34:07 Nachmittag »
Alright here is the most complicated program I have come up with: https://repl.it/@WizardSpartan/Text-Based-Adventure
It's really simple. That explanation ya'll gave made me understand what it does, but I still need help actually implementing it :P.
Here's a program I created to mess around with APIs trying to learn how they work: https://repl.it/@WizardSpartan/API-Testing
I guess right now, I want the user to be able to input a card name, the program retrieves the information using the API (if that's even how it works), and then it outputs the types of the card, CMC, power/toughness, and oracle text of the card. I just need some help bridging the initial gap and then I might be able to experiment and expand my knowledge.

Thanks for your continuing help guys.