Skip to content

Commit 3a6ef4e

Browse files
author
Mark Charlton
committed
Wk6 partial
1 parent c00abac commit 3a6ef4e

File tree

97 files changed

+9965
-0
lines changed

Some content is hidden

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

97 files changed

+9965
-0
lines changed

.history/Assessment/Wk6/pairs_20230310020249.py

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# kims game
2+
3+
UP = '\033[1A'
4+
CLEAR = '\x1b[2K'
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# kims game
2+
3+
# imports
4+
from datetime import datetime
5+
import time
6+
7+
# ESCAPE SEQUENCE CURSOR MOVEMENT
8+
# \033[<L>;<C>H Positions the cursor. Puts the cursor at line L and column C.
9+
# \033[<N>A Move the cursor up by N lines.
10+
# \033[<N>B Move the cursor down by N lines.
11+
# \033[<N>C Move the cursor forward by N columns.
12+
# \033[<N>D Move the cursor backward by N columns.
13+
# \033[2J Clear the screen, move to (0,0)
14+
# \033[K Erase the end of line.
15+
16+
UP = '\033[1A'
17+
CLEAR = '\x1b[2K'
18+
19+
print (" Overwrite task ")
20+
print ( "=" * 20 )
21+
22+
print ( )
23+
for i in range(120):
24+
now = datetime.now()
25+
current_time = now.strftime("%H:%M:%S")
26+
print("Current Time =", current_time)
27+
time.sleep(1)
28+
print ( UP, end=CLEAR)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# kims game
2+
3+
# imports
4+
from datetime import datetime
5+
import time
6+
7+
# ESCAPE SEQUENCE CURSOR MOVEMENT
8+
# \033[<L>;<C>H Positions the cursor. Puts the cursor at line L and column C.
9+
# \033[<N>A Move the cursor up by N lines.
10+
# \033[<N>B Move the cursor down by N lines.
11+
# \033[<N>C Move the cursor forward by N columns.
12+
# \033[<N>D Move the cursor backward by N columns.
13+
# \033[2J Clear the screen, move to (0,0)
14+
# \033[K Erase the end of line.
15+
16+
UP = '\033[1A'
17+
CLEAR = '\x1b[2K'
18+
19+
print (" Overwrite task ")
20+
print ( "=" * 20 )
21+
22+
print ( )
23+
for i in range(120):
24+
now = datetime.now()
25+
current_time = now.strftime("%H:%M:%S")
26+
print("Current Time: ", current_time)
27+
time.sleep(1)
28+
print ( UP, end=CLEAR)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# kims game
2+
3+
# imports
4+
5+
# ESCAPE SEQUENCE CURSOR MOVEMENT
6+
# \033[<L>;<C>H Positions the cursor. Puts the cursor at line L and column C.
7+
# \033[<N>A Move the cursor up by N lines.
8+
# \033[<N>B Move the cursor down by N lines.
9+
# \033[<N>C Move the cursor forward by N columns.
10+
# \033[<N>D Move the cursor backward by N columns.
11+
# \033[2J Clear the screen, move to (0,0)
12+
# \033[K Erase the end of line.
13+
14+
UP = '\033[1A'
15+
CLEAR = '\x1b[2K'
16+
#print ( UP, end=CLEAR)
17+
18+
# inits
19+
20+
d_grid=[]
21+
for i in range(4):
22+
d_grid.append=[{"val": "", "matched": 0},
23+
{"val": "", "matched": 0},
24+
{"val": "", "matched": 0},
25+
{"val": "", "matched": 0}]
26+
27+
l_cards=[]
28+
for i in range(4):
29+
l_cards.append("J")
30+
l_cards.append("Q")
31+
l_cards.append("K")
32+
l_cards.append("A")
33+
34+
print (l_cards)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# kims game
2+
3+
# imports
4+
5+
# ESCAPE SEQUENCE CURSOR MOVEMENT
6+
# \033[<L>;<C>H Positions the cursor. Puts the cursor at line L and column C.
7+
# \033[<N>A Move the cursor up by N lines.
8+
# \033[<N>B Move the cursor down by N lines.
9+
# \033[<N>C Move the cursor forward by N columns.
10+
# \033[<N>D Move the cursor backward by N columns.
11+
# \033[2J Clear the screen, move to (0,0)
12+
# \033[K Erase the end of line.
13+
14+
UP = '\033[1A'
15+
CLEAR = '\x1b[2K'
16+
#print ( UP, end=CLEAR)
17+
18+
# inits
19+
20+
d_grid=[]
21+
for i in range(4):
22+
d_grid.append(=[{"val": "", "matched": 0},
23+
{"val": "", "matched": 0},
24+
{"val": "", "matched": 0},
25+
{"val": "", "matched": 0}])
26+
27+
l_cards=[]
28+
for i in range(4):
29+
l_cards.append("J")
30+
l_cards.append("Q")
31+
l_cards.append("K")
32+
l_cards.append("A")
33+
34+
print (l_cards)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# kims game
2+
3+
# imports
4+
5+
# ESCAPE SEQUENCE CURSOR MOVEMENT
6+
# \033[<L>;<C>H Positions the cursor. Puts the cursor at line L and column C.
7+
# \033[<N>A Move the cursor up by N lines.
8+
# \033[<N>B Move the cursor down by N lines.
9+
# \033[<N>C Move the cursor forward by N columns.
10+
# \033[<N>D Move the cursor backward by N columns.
11+
# \033[2J Clear the screen, move to (0,0)
12+
# \033[K Erase the end of line.
13+
14+
UP = '\033[1A'
15+
CLEAR = '\x1b[2K'
16+
#print ( UP, end=CLEAR)
17+
18+
# inits
19+
20+
d_grid=[]
21+
for i in range(4):
22+
d_grid.append([{"val": "", "matched": 0},
23+
{"val": "", "matched": 0},
24+
{"val": "", "matched": 0},
25+
{"val": "", "matched": 0}])
26+
27+
l_cards=[]
28+
for i in range(4):
29+
l_cards.append("J")
30+
l_cards.append("Q")
31+
l_cards.append("K")
32+
l_cards.append("A")
33+
34+
print (l_cards)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# kims game
2+
3+
# imports
4+
5+
# ESCAPE SEQUENCE CURSOR MOVEMENT
6+
# \033[<L>;<C>H Positions the cursor. Puts the cursor at line L and column C.
7+
# \033[<N>A Move the cursor up by N lines.
8+
# \033[<N>B Move the cursor down by N lines.
9+
# \033[<N>C Move the cursor forward by N columns.
10+
# \033[<N>D Move the cursor backward by N columns.
11+
# \033[2J Clear the screen, move to (0,0)
12+
# \033[K Erase the end of line.
13+
14+
UP = '\033[1A'
15+
CLEAR = '\x1b[2K'
16+
#print ( UP, end=CLEAR)
17+
18+
# inits
19+
20+
d_grid=[]
21+
for i in range(4):
22+
d_grid.append([{"val": "", "matched": 0},
23+
{"val": "", "matched": 0},
24+
{"val": "", "matched": 0},
25+
{"val": "", "matched": 0}])
26+
27+
print (d_grid)
28+
29+
l_cards=[]
30+
for i in range(4):
31+
l_cards.append("J")
32+
l_cards.append("Q")
33+
l_cards.append("K")
34+
l_cards.append("A")
35+
36+
print (l_cards)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# kims game
2+
3+
# imports
4+
import random as r
5+
6+
# ESCAPE SEQUENCE CURSOR MOVEMENT
7+
# \033[<L>;<C>H Positions the cursor. Puts the cursor at line L and column C.
8+
# \033[<N>A Move the cursor up by N lines.
9+
# \033[<N>B Move the cursor down by N lines.
10+
# \033[<N>C Move the cursor forward by N columns.
11+
# \033[<N>D Move the cursor backward by N columns.
12+
# \033[2J Clear the screen, move to (0,0)
13+
# \033[K Erase the end of line.
14+
15+
UP = '\033[1A'
16+
CLEAR = '\x1b[2K'
17+
#print ( UP, end=CLEAR)
18+
19+
# inits
20+
21+
d_grid=[]
22+
for i in range(4):
23+
d_grid.append([{"val": "", "matched": 0},
24+
{"val": "", "matched": 0},
25+
{"val": "", "matched": 0},
26+
{"val": "", "matched": 0}])
27+
28+
print (d_grid)
29+
30+
l_cards=[]
31+
for i in range(4):
32+
l_cards.append("J")
33+
l_cards.append("Q")
34+
l_cards.append("K")
35+
l_cards.append("A")
36+
37+
r.shuffle(l_cards)
38+
39+
for i in range(4):
40+
for j in range(4):
41+
d_grid[i][j]["val"]=l_cards.pop()
42+
43+
print ( d_grid )
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# kims game
2+
3+
# imports
4+
import random as r
5+
6+
# ESCAPE SEQUENCE CURSOR MOVEMENT
7+
# \033[<L>;<C>H Positions the cursor. Puts the cursor at line L and column C.
8+
# \033[<N>A Move the cursor up by N lines.
9+
# \033[<N>B Move the cursor down by N lines.
10+
# \033[<N>C Move the cursor forward by N columns.
11+
# \033[<N>D Move the cursor backward by N columns.
12+
# \033[2J Clear the screen, move to (0,0)
13+
# \033[K Erase the end of line.
14+
15+
UP = '\033[1A'
16+
CLEAR = '\x1b[2K'
17+
#print ( UP, end=CLEAR)
18+
19+
# inits
20+
21+
d_grid=[]
22+
for i in range(4):
23+
d_grid.append([{"val": "", "matched": 0},
24+
{"val": "", "matched": 0},
25+
{"val": "", "matched": 0},
26+
{"val": "", "matched": 0}])
27+
28+
print (d_grid)
29+
30+
l_cards=[]
31+
for i in range(4):
32+
l_cards.append("J")
33+
l_cards.append("Q")
34+
l_cards.append("K")
35+
l_cards.append("A")
36+
37+
r.shuffle(l_cards)
38+
39+
for i in range(4):
40+
for j in range(4):
41+
d_grid[i][j]["val"]=l_cards.pop()
42+
43+
for i in range(4):
44+
print ( d_grid[i] )

0 commit comments

Comments
 (0)