I am working on a project for an minesweeper simple game that also generate sha256 hash function to code game results and prove player fairness before we show if he wins or lost. I need to finish the project as fast possible and i need help. Also I need for results of hashes to be stored in some kind of database table. It must 3 columns sorted like these: random mines numbers, an random set of strings and numbers, the resulting hash 256SHA function generated from these 2 factors. Also it needs to open the file database and then it must search from all 3 collums but first 256SHA resulting hashes. Here is what I code so far:
#Statoshi Minswepper game recording.
import random
import hashlib
import string
import os
#chose some random mines from 25 cells need to redesign function
boom = random.sample(range(1, 25), 5)
cellch = raw_input("Chose the cell numbers", )
print "It explodes BOOM!!!!!", boom
chrs = string.ascii_letters + string.digits
rgen = random.choice(chrs)
print rgen
# this is an fair game hash function
rchr = boom, rgen
print "The hash fair game", rchr
I hope you will understand the code so far. I have not commented all but I hope that you guys understand what it dose. If you can help me with and class function object oriented I wold appreciate.
Aucun commentaire:
Enregistrer un commentaire