Skip to content

juliabanerjee/card-deck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

card-deck

This is a project to help with my GoLang learning.

By using the functions I have written, the user is able to create a deck of cards and manipulate them.

My functions:

newDeck:

This function creates a new deck with all 52 cards listed out in order for each suit. Ie "Ace of Spades", "Two of Spades", "Three of Spades" ... etc. I did this by creating three empty slices of strings, one for the deck itself, one for card suits and one for card values. I then used a nested for loop to iterate over each suit and value to create each card and append them to the empty deck slice. To finish this function and list out the deck inn the terminal, I printed each index of the deck slice.

deal:

In order to create a hand out ofmy deck, I

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages