Ask your own question, for FREE!
Computer Science 23 Online
OpenStudy (anonymous):

Write a function called deal() which takes three arguments; a deck of cards, the number of cards to deal, and the number of players. deal() returns a tuple where the first element of the tuple is a list and the second element of the tuple is the list of cards which have not been dealt. The first part of the tuple gives a list of lists, where each list represents the hand of each player. It shows the cards that have been dealt to each player.

OpenStudy (anonymous):

what lang?

OpenStudy (anonymous):

what have you done?

OpenStudy (anonymous):

where did you stuck?

OpenStudy (anonymous):

and where did you stuck?

OpenStudy (anonymous):

that code which is written a very good indeed, written in a real pythonish way, lol

OpenStudy (anonymous):

so you have no idea at all for 5?

OpenStudy (anonymous):

you cant even write a function name with an input arguments? lol

OpenStudy (anonymous):

have you wrote previous code yourself..?

OpenStudy (dumbsearch2):

OOOOHHHH THE WEATHER GETS HOT IN CALI!!

OpenStudy (anonymous):

i dont want to insult but a bit strange, just a bit starnge that no ideas (and i also really like that code very much and if someone wrote that code he should know hwo to do next part too lol) so basicaly you jsut create deck with function you have then you shuffle some n times, just pick a number yourself then you assign cards to different players and remove from the deck and then you return those n players card and remaining deck

OpenStudy (anonymous):

this is not a perfect solution because when you shuffle first card always be the same but i guess they want you to use shuffle function

OpenStudy (dumbsearch2):

oh, why did you delete your code, shamincy ? ;/

OpenStudy (anonymous):

i have saved her code #question 1 suits=['H','C','S','D'] facevalues=['2','3','4','5','6','7','8','9','10','J','Q','K','A'] def makedeck(): S=suits FV=facevalues return [(s,fv) for s in suits for fv in facevalues] #question 2 def split(lst): x= int(len(lst)/2) lst1=lst[:x] lst2=lst[x:] return lst1, lst2 #question 3 def interleave(lst1,lst2): if len(lst1)==0 and len(lst2)==0: return [] if len(lst1)==0: return lst2 if len(lst2)==0: return lst1 y =[lst1[0],lst2[0]] return y + interleave(lst1[1:],lst2[1:]) #question 4 def shuffle(n, lst): for i in range(n): lst1, lst2 = split(lst) lst = interleave(lst1, lst2) return lst if you want me to delete it just tell

OpenStudy (anonymous):

i have told you complete algorithm what to do.. you just need to write code which is easy

OpenStudy (dumbsearch2):

lol. thats an obvious sign of an obvious cheater who's obvious copy/pasting code and is obviously asking others to do her own work and is obviously insulting others for helping but not doing all her work for her. And when they point out that she may be cheating she (obviously) yells at them. WOW. Just to let you know, @shamincy, cheating is against the CoC. http://openstudy.com/code-of-conduct You obviously don't know how to write the second part; so how could you have written the first part ? Excuse my obviouses.... But srly. Obvious trolls are obvious. ;p

OpenStudy (anonymous):

yay im not the only one thinking same thing and anyway i have given complete algorithm which is more than enough to complete 5th part

OpenStudy (anonymous):

http://openstudy.com/users/shamincy#/updates/516af9cde4b0be6bc9544d7d here i can see that someone wrote shuffle for you

OpenStudy (dumbsearch2):

good catch, thomas!!

OpenStudy (dumbsearch2):

you said you wrote the code. you didn't. [period]

OpenStudy (dumbsearch2):

= lier

OpenStudy (dumbsearch2):

+ cheater

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!