Categories: DiscussionGwent

I wrote some Python3 code that will generate a random ST devotional deck for you

Hi, so I recently watched a couple Fuschia Briefs video where he spends 20 minutes randomly generating decks and I wondered if it could be possible to do this with python code.

I am a student in university and I have a summer class coming up where I'll be asked to write code that does a lot of array manipulation. My coding skills are not great so I picked this task as a way to sharpen what little skills I have just a bit. I'm sure more advanced coders will see my code and cringe because it is very amateurish. But it works and Ive tested in in online python compilers to make sure its not just working on my machine.

It's not commented and there's some unused variables. Apologies. I'm not sure if sharing this kind of code goes against any rules? It's certainly not malicious, it's just doing some basic for loops, array manipulation (for the deck and cardpool) and random integer generation.

You will have a ST leader ability and stratagem randomly assigned to you as well. All decks are pretty much devotional only because it's a very time consuming process to type all the card names out. This is mostly a proof of concept, I welcome anyone else to build on it and make something that includes neutral cards or other factions.

If this goes against any reddit rules I apologize.

My (original) code:

https://pastebin.com/METKL8iA

edit:

I have updated the code to now include neutral units. No longer devotional! Still we are only limited to ST. Here you go. I accidentally left in some debug print function and its possible I might have coded a unit as a special or a special as a unit somewhere at some point. An impossible to build deck might possibly be generated but Im not sure.

https://pastebin.com/b5EDYkSt

Gamer

Recent Posts

Ledx have been so hard for me this wipe

Not being able to craft them sucks. Especially when everyone I talk to about it…

11 months ago

My interesting and unfortunate Gwent life

First I'd like to say I absolutely love this game it's quality. Basically I first…

11 months ago

Teacher Tuesday 12/Dec/2023 – ask your questions here!

Welcome to Teacher Tuesday, a thread where anyone can ask any type of question without…

11 months ago

This games balance is confusing

I’m kind of new/returning to gwent I played beta and obviously it’s a lot lot…

11 months ago

Summary of 10 Days of Draws from Chaffee’s Bundles

Level 1 Bag (Free with Atmosphere Level 2) 6 small consumable (First Aid, Repair, Fire…

11 months ago

Why is my crew at 135%?

Here's my crew - T34-85M - for the life of me I cant figure out…

11 months ago