Skip to content

Commit 3f5fcc8

Browse files
authored
Merge pull request #5 from salipshitz/1.0.2
1.0.2 ALPHA
2 parents 687d23e + 2042c2a commit 3f5fcc8

File tree

1,307 files changed

+169925
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,307 files changed

+169925
-16
lines changed
+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
from random import randint
2+
enem_board = [[u"\U0001F30A"]*5 for n in range(5)]
3+
frnd_board = [[u"\U0001F30A"]*5 for n in range(5)]
4+
name = "Sa'ar"
5+
def print_board(frnd, enem):
6+
print("CPU")
7+
print(end=" ")
8+
for i in range(1, len(enem[0])+1):
9+
print(i, end=" ")
10+
print()
11+
for i in range(1, len(enem[0])+1):
12+
row = enem[i-1]
13+
print(i," ".join(row))
14+
print("-".join(["--"]*5))
15+
print(name)
16+
print(end=" ")
17+
for i in range(1, len(frnd[0])+1):
18+
print(i, end=" ")
19+
print()
20+
for i in range(1, len(frnd)+1):
21+
row = frnd[i-1]
22+
print(i," ".join(row))
23+
print()
24+
#computer hide
25+
row = randint(0, len(enem_board)-1)
26+
col = randint(0, len(enem_board[0])-1)
27+
#player hide
28+
pr = None
29+
pc = None
30+
while pr == None and pc == None:
31+
if pr == None:
32+
pr = randint(1, len(frnd_board))
33+
pr -= 1
34+
if pc == None:
35+
pc = randint(1, len(frnd_board))
36+
pc -= 1
37+
if pc < 0 or pc >= len(frnd_board[0]):
38+
pc = None
39+
if pr < 0 or pr > len(frnd_board):
40+
pr = None
41+
else:
42+
print(pr+1,pc+1)
43+
frnd_board[pr][pc] = u"\U0001F6A2"
44+
45+
won = False
46+
lost = False
47+
while (not won) and (not lost):
48+
print_board(frnd_board, enem_board)
49+
print("CPU: ")
50+
t = False
51+
while not t:
52+
gr = randint(0, len(frnd_board)-1)
53+
gc = randint(0, len(frnd_board[0])-1)
54+
if frnd_board[gr][gc] != u"\U0001F4A3":
55+
t = True
56+
print("Row: ",gr+1)
57+
print("Column: ",gc+1)
58+
print()
59+
if frnd_board[gr][gc] == u"\U0001F6A2":
60+
lost = True
61+
frnd_board[gr][gc] = u"\U0001F4A5"
62+
print("Hit!")
63+
break
64+
else:
65+
frnd_board[gr][gc] = u"\U0001F4A3"
66+
print("Miss!")
67+
print()
68+
print_board(frnd_board, enem_board)
69+
print(name+":")
70+
gr = randint(1, len(enem_board))
71+
gr -= 1
72+
print("Row:",gr)
73+
gc = randint(1, len(enem_board[0]))
74+
gc -= 1
75+
print("Column:",gc)
76+
print()
77+
if gr == row and gc == col:
78+
print("Hit!")
79+
enem_board[gr][gc] = u"\U0001F4A5"
80+
won = True
81+
elif gr < 0 or gr >= len(enem_board) or gc < 0 or gc >= len(enem_board[0]):
82+
print("That's not even in the ocean ):")
83+
elif enem_board[gr][gc] == u"\U0001F4A3":
84+
print("You already guessed that, stupid! DX")
85+
else:
86+
print("Miss!")
87+
print()
88+
enem_board[gr][gc] = u"\U0001F4A3"
89+
if won:
90+
for i in range(len(enem_board)):
91+
for j in range(len(enem_board[i])):
92+
if not enem_board[i][j] == u"\U0001F4A3":
93+
enem_board[i][j] = u"\U0001F525"
94+
else:
95+
enem_board[i][j] = u"\u2620"
96+
enem_board[row][col] = u"\U0001F4A5"
97+
print("Congrats on winning!")
98+
if lost:
99+
for i in range(len(frnd_board)):
100+
for j in range(len(frnd_board[i])):
101+
if not frnd_board[i][j] == u"\U0001F4A3":
102+
frnd_board[i][j] = u"\U0001F525"
103+
else:
104+
frnd_board[i][j] = u"\u2620"
105+
frnd_board[pr][pc] = u"\U0001F4A5"
106+
enem_board[row][col] = u"\U0001F6A2"
107+
print("You sax. Better luck next time!")
108+
print_board(frnd_board, enem_board)

__pycache__/mainloop.cpython-34.pyc

190 Bytes
Binary file not shown.

__pycache__/screens.cpython-34.pyc

10 KB
Binary file not shown.

__pycache__/screens.cpython-35.pyc

1.85 KB
Binary file not shown.

__pycache__/window.cpython-34.pyc

-39 Bytes
Binary file not shown.

dist/LearnPythonWithPython.exe

7 KB
Binary file not shown.

dist/_bz2.pyd

61.5 KB
Binary file not shown.

dist/_ctypes.pyd

106 KB
Binary file not shown.

dist/_hashlib.pyd

1.5 MB
Binary file not shown.

dist/_lzma.pyd

133 KB
Binary file not shown.

dist/_socket.pyd

51 KB
Binary file not shown.

dist/_ssl.pyd

2.12 MB
Binary file not shown.

dist/_tkinter.pyd

44 KB
Binary file not shown.

dist/library.zip

3.42 MB
Binary file not shown.

dist/pyexpat.pyd

164 KB
Binary file not shown.

dist/python34.dll

3.88 MB
Binary file not shown.

dist/select.pyd

10.5 KB
Binary file not shown.

dist/tcl/dde1.4/pkgIndex.tcl

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
if {([info commands ::tcl::pkgconfig] eq "")
2+
|| ([info sharedlibextension] ne ".dll")} return
3+
if {[::tcl::pkgconfig get debug]} {
4+
package ifneeded dde 1.4.0 [list load [file join $dir tcldde14g.dll] dde]
5+
} else {
6+
package ifneeded dde 1.4.0 [list load [file join $dir tcldde14.dll] dde]
7+
}

dist/tcl/dde1.4/tcldde14.dll

21 KB
Binary file not shown.

dist/tcl/itcl4.0.0/itcl.tcl

+148
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
#
2+
# itcl.tcl
3+
# ----------------------------------------------------------------------
4+
# Invoked automatically upon startup to customize the interpreter
5+
# for [incr Tcl].
6+
# ----------------------------------------------------------------------
7+
# AUTHOR: Michael J. McLennan
8+
# Bell Labs Innovations for Lucent Technologies
9+
# mmclennan@lucent.com
10+
# http://www.tcltk.com/itcl
11+
# ----------------------------------------------------------------------
12+
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
13+
# ======================================================================
14+
# See the file "license.terms" for information on usage and
15+
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
16+
17+
proc ::itcl::delete_helper { name args } {
18+
::itcl::delete object $name
19+
}
20+
21+
# ----------------------------------------------------------------------
22+
# USAGE: local <className> <objName> ?<arg> <arg>...?
23+
#
24+
# Creates a new object called <objName> in class <className>, passing
25+
# the remaining <arg>'s to the constructor. Unlike the usual
26+
# [incr Tcl] objects, however, an object created by this procedure
27+
# will be automatically deleted when the local call frame is destroyed.
28+
# This command is useful for creating objects that should only remain
29+
# alive until a procedure exits.
30+
# ----------------------------------------------------------------------
31+
proc ::itcl::local {class name args} {
32+
set ptr [uplevel [list $class $name] $args]
33+
uplevel [list set itcl-local-$ptr $ptr]
34+
set cmd [uplevel namespace which -command $ptr]
35+
uplevel [list trace variable itcl-local-$ptr u \
36+
"::itcl::delete_helper $cmd"]
37+
return $ptr
38+
}
39+
40+
# ----------------------------------------------------------------------
41+
# auto_mkindex
42+
# ----------------------------------------------------------------------
43+
# Define Itcl commands that will be recognized by the auto_mkindex
44+
# parser in Tcl...
45+
#
46+
47+
#
48+
# USAGE: itcl::class name body
49+
# Adds an entry for the given class declaration.
50+
#
51+
foreach cmd {itcl::class class itcl::type type ictl::widget widget itcl::widgetadaptor widgetadaptor itcl::extendedclass extendedclass} {
52+
auto_mkindex_parser::command $cmd {name body} {
53+
variable index
54+
variable scriptFile
55+
append index "set [list auto_index([fullname $name])]"
56+
append index " \[list source \[file join \$dir [list $scriptFile]\]\]\n"
57+
58+
variable parser
59+
variable contextStack
60+
set contextStack [linsert $contextStack 0 $name]
61+
$parser eval $body
62+
set contextStack [lrange $contextStack 1 end]
63+
}
64+
}
65+
66+
#
67+
# USAGE: itcl::body name arglist body
68+
# Adds an entry for the given method/proc body.
69+
#
70+
foreach cmd {itcl::body body} {
71+
auto_mkindex_parser::command $cmd {name arglist body} {
72+
variable index
73+
variable scriptFile
74+
append index "set [list auto_index([fullname $name])]"
75+
append index " \[list source \[file join \$dir [list $scriptFile]\]\]\n"
76+
}
77+
}
78+
79+
#
80+
# USAGE: itcl::configbody name arglist body
81+
# Adds an entry for the given method/proc body.
82+
#
83+
foreach cmd {itcl::configbody configbody} {
84+
auto_mkindex_parser::command $cmd {name body} {
85+
variable index
86+
variable scriptFile
87+
append index "set [list auto_index([fullname $name])]"
88+
append index " \[list source \[file join \$dir [list $scriptFile]\]\]\n"
89+
}
90+
}
91+
92+
#
93+
# USAGE: ensemble name ?body?
94+
# Adds an entry to the auto index list for the given ensemble name.
95+
#
96+
foreach cmd {itcl::ensemble ensemble} {
97+
auto_mkindex_parser::command $cmd {name {body ""}} {
98+
variable index
99+
variable scriptFile
100+
append index "set [list auto_index([fullname $name])]"
101+
append index " \[list source \[file join \$dir [list $scriptFile]\]\]\n"
102+
}
103+
}
104+
105+
#
106+
# USAGE: public arg ?arg arg...?
107+
# protected arg ?arg arg...?
108+
# private arg ?arg arg...?
109+
#
110+
# Evaluates the arguments as commands, so we can recognize proc
111+
# declarations within classes.
112+
#
113+
foreach cmd {public protected private} {
114+
auto_mkindex_parser::command $cmd {args} {
115+
variable parser
116+
$parser eval $args
117+
}
118+
}
119+
120+
# ----------------------------------------------------------------------
121+
# auto_import
122+
# ----------------------------------------------------------------------
123+
# This procedure overrides the usual "auto_import" function in the
124+
# Tcl library. It is invoked during "namespace import" to make see
125+
# if the imported commands reside in an autoloaded library. If so,
126+
# stubs are created to represent the commands. Executing a stub
127+
# later on causes the real implementation to be autoloaded.
128+
#
129+
# Arguments -
130+
# pattern The pattern of commands being imported (like "foo::*")
131+
# a canonical namespace as returned by [namespace current]
132+
133+
proc auto_import {pattern} {
134+
global auto_index
135+
136+
set ns [uplevel namespace current]
137+
set patternList [auto_qualify $pattern $ns]
138+
139+
auto_load_index
140+
141+
foreach pattern $patternList {
142+
foreach name [array names auto_index $pattern] {
143+
if {"" == [info commands $name]} {
144+
::itcl::import::stub create $name
145+
}
146+
}
147+
}
148+
}

dist/tcl/itcl4.0.0/itcl40t.dll

270 KB
Binary file not shown.

0 commit comments

Comments
 (0)