Share your repls and programming experiences

← Back to all posts
2 player War (Card Game)
Kurplunk100 (16)

Bad war game in free time, don't judge. Press enter to draw.

Comments
hotnewtop
YixuanWang1 (2)

it takes too long

Kurplunk100 (16)

It is, but the amount of cards in a normal deck while playing war. @YixuanWang1

YixuanWang1 (2)

i dont mean the game is long, what i mean is that it takes too long to scroll dowwn @Kurplunk100

Kurplunk100 (16)

Do you know if there is a way to delete the previous line after you press enter? @YixuanWang1

johnroberts (1)

To clear the screen you can use:
import os
os.system("clear")

ChezCoder (1594)

@Kurplunk100 or you can make a clear function:

import os

def clear():
    if os.name == 'nt':
        os.system('cls')
    else:
        os.system('clear')

print('Hello')
clear()
print('World')
TobyS (57)

I have no idea how this game works. Do i just keep pressing enter?