Skip to content
← Back to Community
How to make everything on one line?
Profile icon
Bookie0

Hey everyone,`
So i have this function with the card. I want there to be those 4 cards, but when I call the function 4 times, the four cards are vertical; they are in a column.
So the question is how to make them all on 1 line when I call the functions, like one after another

Thanks for any help!

def card_dont_know(): print(bright_magenta+""" _____________ / \ | | | | | | | ??? | | | | | | | | | \_____________/ """) card_dont_know() card_dont_know() card_dont_know() card_dont_know()
Answered by ChezCoder [earned 5 cycles]
View Answer
Voters
Profile icon
DamienKilduff
Profile icon
lolguineapig
Profile icon
ChezCoder
Profile icon
Bookie0
Comments
hotnewtop
Profile icon
ChezCoder

@Bookie0
I did it! Made exclusively for @Bookie0:

def print_card(number): print(bright_magenta + (" _____________ " * number) + "\n" + (" / \ " * number) + "\n" + (" | | " * number) + "\n" + (" | | " * number) + "\n" + (" | | " * number) + "\n" + (" | ??? | " * number) + "\n" + (" | | " * number) + "\n" + (" | | " * number) + "\n" + (" | | " * number) + "\n" + (" | | " * number) + "\n" + (" \_____________/ " * number) ) print_card(2) # print 2 cards on the same line :D

@Coder100 it wasn't that complicated

Profile icon
Bookie0

Oh wow thank you so much! It works now! @ChezCoder

Profile icon
ChezCoder

@Bookie0 :DDD <3

Profile icon
ChezCoder

@Bookie0 can i help you with your 4 chances game?

Profile icon
Bookie0

Woah youve been looking at my profile game... Lol ok @ChezCoder ill invite you

Profile icon
ChezCoder

@Bookie0 lol after i answer a question, i usually check the profile to see how its used XD

Profile icon
Bookie0

Ah ok. I might have to go in a bit but you can just look at it a bit @ChezCoder

Profile icon
CodingCactus

@ChezCoder lol that is what i was going to do but had to go learn stuff at school :)

Profile icon
Bookie0

Hey, are you on the game? @ChezCoder it says you left

Profile icon
Coder100

hi nice, i was thinking about like different cards @Bookie0

Profile icon
ChezCoder

@Bookie0 sorry, lunch

Profile icon
Bookie0

Ah ok, thanks anyways! @Coder100

Profile icon
Bookie0
Profile icon
Bookie0

Hey I see ur on the repl! :) @ChezCoder

Profile icon
ChezCoder

@Bookie0 :D im on

Profile icon
Coder100
Profile icon
Bookie0
Profile icon
Bookie0

Hey, I’m back how did it go? Is it working now? :) @ChezCoder

Profile icon
Bookie0

Hey, I just ran the 4 chances game, and for some reason it doesn’t go through the login system it just goes to the game and also, when I get the skull and lose, it doesn’t propose to play again.
Did you maybe turn the login system off?

Tell me when you’re available!
Thanks! : ) :):):):) @ChezCoder

Profile icon
ChezCoder

@Bookie0 sorry, i made it so that when you get skull, the game doesn't end but rather your rounds and currency set to 0 :) or else it will confuse players to thinking the game ended when it hasnt

Profile icon
Bookie0

Ah ok, :D but what about the login system? @ChezCoder

Profile icon
ChezCoder

@Bookie0 im working on sessions to make the cashout work

Profile icon
Bookie0

Ok what sessions? @ChezCoder

Profile icon
ChezCoder

@Bookie0 basically a file that saves your login info temporarily so that you don't have to login each time you visit the repl. (sessions disappear when you reload)

Profile icon
Coder100

Hello, to do that would be very complicated and so basically the thing is:

  • All the lines are split into an array
  • Concat each line of each array together
  • Join them together

So basically
if we had

|-| |-| |-|

as the "card",

then we would split into an array

[ "|-|", "|-|", "|-|" ]

then it would become

[ "|-|"+"|-|", ... ]

and finally

|-||-|... |-||-|...

as the result!

Profile icon
Bookie0

Uhh how to do that please? @Coder100

Profile icon
Coder100

hello i edited it :) @Bookie0

Profile icon
Bookie0

Ok lemme try it but thanks in advance @Coder100

Profile icon
ChezCoder

@Coder100 lol i don't think the array part is nessecary, cant you just do string multiplication thing? "hi" * 2

Profile icon
CodingCactus

erm you can't, that is how print works

Profile icon
Bookie0

Ah ok, that’s annoying. Thanks anyways @CodingCactus

Profile icon
CodingCactus

@Bookie0 i can try and do something, but i am in school now, remind me on discord at like 3:50 (1 hour from now)

Profile icon
Bookie0

Ok sure, thanks I’ll ping you @CodingCactus

Profile icon
ChezCoder

@Bookie0 i solved it, look at my answer :D