Sinisterly

Full Version: My first Program
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Here is my First Program.

Basically all it does it Shuffles a deck of cards, an easy beginner program. any suggestions on how I could improve it?

Thanks to @Ex094 for his awesome beginners Python tutorial!

source included.

Code:
#Program created by Root@LocalHost
#Thanks to Exo94 for his awesome python help
#This program will shuffle a deck of cards


import itertools, random

#here is the deck of cards, Call them whatever you like.
deck = list(itertools.product(range(1,14), ['spade', 'heart', 'diamond', 'club']))

#this bit will shuffle the deck of cards
random.shuffle(deck)

#This will draw(how many cards you like)
print('You got:')
for i in range(3):
    print(deck[i][0], "of", deck[i][1])
Glad to see you are making progress Smile Hook me up with a PM if ya need any further help..
(06-18-2014, 03:04 PM)Ex094 Wrote: [ -> ]Glad to see you are making progress Smile Hook me up with a PM if ya need any further help..

Do you any ideas on how I can take this project a step further? As at the moment it is very dull and thank-you Confusedmile:
(06-18-2014, 03:05 PM)root@localhost Wrote: [ -> ]
(06-18-2014, 03:04 PM)Ex094 Wrote: [ -> ]Glad to see you are making progress Smile Hook me up with a PM if ya need any further help..

Do you any ideas on how I can take this project a step further? As at the moment it is very dull and thank-you Confusedmile:

I can't give you any tips on this small script since it's operation is limited but you can make a card game
(06-18-2014, 03:14 PM)Ex094 Wrote: [ -> ]
(06-18-2014, 03:05 PM)root@localhost Wrote: [ -> ]
(06-18-2014, 03:04 PM)Ex094 Wrote: [ -> ]Glad to see you are making progress Smile Hook me up with a PM if ya need any further help..

Do you any ideas on how I can take this project a step further? As at the moment it is very dull and thank-you Confusedmile:

I can't give you any tips on this small script since it's operation is limited but you can make a card game

Since python supports sockets I am going to attempt to create a tiny port scanner Confusedmile: I was wondering if you could create me some text art for it?
Text art, for a port scanner? I'd put more focus into the actual functioning of your project, than the interface Wink

A port scanner is a simple task, I did it in less than 60 lines of code, with error handling. Let me know if you hit any walls.
(06-18-2014, 03:26 PM)root@localhost Wrote: [ -> ]
(06-18-2014, 03:14 PM)Ex094 Wrote: [ -> ]
(06-18-2014, 03:05 PM)root@localhost Wrote: [ -> ]
(06-18-2014, 03:04 PM)Ex094 Wrote: [ -> ]Glad to see you are making progress Smile Hook me up with a PM if ya need any further help..

Do you any ideas on how I can take this project a step further? As at the moment it is very dull and thank-you Confusedmile:

I can't give you any tips on this small script since it's operation is limited but you can make a card game

Since python supports sockets I am going to attempt to create a tiny port scanner Confusedmile: I was wondering if you could create me some text art for it?

I don't wanna discourage you but there are lots of port scanners out there, Be Creative and think out of the box Smile I am not saying don't make it, just saying that use your imagination and create something better. If you like PM me and I'll give you some heads up
(06-18-2014, 03:33 PM)Anima Templi Wrote: [ -> ]Text art, for a port scanner? I'd put more focus into the actual functioning of your project, than the interface Wink

A port scanner is a simple task, I did it in less than 60 lines of code, with error handling. Let me know if you hit any walls.

Thanks man!
This is a version of your program with a prettier print out Biggrin
Check it out..

Code:
import itertools, random

#here is the deck of cards, Call them whatever you like.
deck = list(itertools.product(range(1,14), ['spade', 'heart', 'diamond', 'club']))

#this bit will shuffle the deck of cards
random.shuffle(deck)

#This will draw(how many cards you like)
print('You got:')
for i in range(3):
    print("{:<2} {:<2} {:<10}".format(str(deck[i][0]),"of",str(deck[i][1])))

(06-18-2014, 03:33 PM)Anima Templi Wrote: [ -> ]Text art, for a port scanner? I'd put more focus into the actual functioning of your project, than the interface Wink

A port scanner is a simple task, I did it in less than 60 lines of code, with error handling. Let me know if you hit any walls.

You used python-nmap library to do it dude or just with the socket module?
I used sockets.
Pages: 1 2