Skip to content

Commit 9b6ce8e

Browse files
committed
[main] Added test file
1 parent e76bdcc commit 9b6ce8e

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

jsProblems/test/testfile.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
const MillisecondConstants = {
2+
DAY: 86_400_000,
3+
WEEK: 604_800_000,
4+
};
5+
6+
const Dates = {
7+
SUNDAY: 0,
8+
MONDAY: 1,
9+
TUESDAY: 2,
10+
WEDNESDAY: 3,
11+
THURSDAY: 4,
12+
FRIDAY: 5,
13+
SATURDAY: 6,
14+
};
15+
16+
const Direction = {
17+
ASC: 0,
18+
DESC: 1,
19+
};
20+
21+
/**
22+
*
23+
* @param date - The date to span it's surrounding dates for
24+
* @returns The day that is found from searching around the current date
25+
*/
26+
const findDay = (date, day, direction) => {
27+
let foundDate = date.getDay() === day;
28+
let movingDate = new Date(date);
29+
while (!foundDate) {
30+
movingDate = new Date(
31+
movingDate.getTime() +
32+
(direction === Direction.ASC
33+
? MillisecondConstants.DAY
34+
: -MillisecondConstants.DAY)
35+
);
36+
foundDate = movingDate.getDay() === day;
37+
}
38+
return movingDate;
39+
};
40+
41+
/**
42+
* Generates the date range from the date supplied to it
43+
*
44+
* @param date - The date we are analyzing
45+
*/
46+
const generateDateRange = (date) => {
47+
const lowerDate = findDay(
48+
new Date(date.getTime() - MillisecondConstants.WEEK),
49+
Dates.SATURDAY,
50+
Direction.ASC
51+
);
52+
const upperDate = findDay(new Date(date), Dates.SUNDAY, Direction.DESC);
53+
return [lowerDate, upperDate];
54+
};
55+
56+
generateDateRange(new Date());

pythonProblems/test/test.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# set the board
2+
board = ["-","-","-",
3+
"-","-","-",
4+
"-","-","-"]
5+
6+
# set the player
7+
currentPlayer = "p1"
8+
winner = None
9+
gameRunning = True
10+
# print the game board
11+
def printBoard(board):
12+
print(board[0]+"|" + board[1]+"|"+ board[2] + "|")
13+
print("-----------")
14+
print(board[3]+"|" + board[4]+"|"+ board[5] + "|")
15+
print("-----------")
16+
print(board[6]+"|" + board[7]+"|"+ board[8] + "|")
17+
print("-----------")
18+
19+
20+
def _(int, str)-> MemoryError | ZeroDivisionError:
21+
print(len(list(set(list()))))
22+
if int == 1 and str == 1:
23+
return (not not(True + (not True and not False or (not False)))) + (_.__code__.co_argcount - 1)
24+
else:
25+
if False is int and False + (not(not(not(not(not(not(not(not(not(False)))))))))):
26+
return 3
27+
else:
28+
return (lambda: lambda: lambda: round((lambda: float(int + str))()))()()()
29+
30+
31+
print(_(4, 4))

0 commit comments

Comments
 (0)