diff --git a/Bengaluru_map.html b/Bengaluru_map.html new file mode 100644 index 0000000..886d9a9 --- /dev/null +++ b/Bengaluru_map.html @@ -0,0 +1,93 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Delhi_map.html b/Delhi_map.html new file mode 100644 index 0000000..bfb7b30 --- /dev/null +++ b/Delhi_map.html @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Jaipur_map.html b/Jaipur_map.html new file mode 100644 index 0000000..96d46d8 --- /dev/null +++ b/Jaipur_map.html @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Kanpur_map.html b/Kanpur_map.html new file mode 100644 index 0000000..693ad58 --- /dev/null +++ b/Kanpur_map.html @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MathsSolver/maths_solver.py b/MathsSolver/maths_solver.py index 5eb459e..cc1a2c5 100644 --- a/MathsSolver/maths_solver.py +++ b/MathsSolver/maths_solver.py @@ -30,7 +30,6 @@ def solve_equation(equation): except Exception as e: return f"Error solving equation: {str(e)}" - def trigonometric_function(func, angle): try: angle_rad = np.radians(angle) @@ -45,7 +44,6 @@ def trigonometric_function(func, angle): except Exception as e: return f"Error: {str(e)}" - def differentiate(expr): try: x = sp.symbols('x') @@ -60,13 +58,11 @@ def integrate(expr): except Exception as e: return f"Error in integration: {str(e)}" - def factorial(n): if n < 0: raise ValueError("Negative numbers do not have a factorial.") return math.factorial(n) - def fibonacci(n): try: if n <= 0: @@ -78,7 +74,6 @@ def fibonacci(n): except Exception as e: return f"Error: {str(e)}" - def matrix_operations(matrix_a, matrix_b, operation): try: if operation == 'add': @@ -172,7 +167,6 @@ def statistical_analysis(data): except Exception as e: return f"Error in statistical analysis: {str(e)}" - def complex_operations(op, a, b): try: a_complex = complex(a) @@ -191,7 +185,6 @@ def complex_operations(op, a, b): except Exception as e: return f"Error: {str(e)}" - def unit_conversion(value, from_unit, to_unit): conversion_factors = { 'meters_to_feet': 3.28084, @@ -275,189 +268,10 @@ def extract_complex_operation(command): def extract_units(command): # Example: extract value and units from "convert 10 meters to feet" - match = re.search(r'convert (\d+\.?\d*) (\w+) to (\w+)', command) + match = re.search(r'convert (\d+) (\w+) to (\w+)', command) if match: value = float(match.group(1)) from_unit = match.group(2) to_unit = match.group(3) return value, from_unit, to_unit return None, None, None - -def extract_range(command): - # Example: extract range from "plot x**2 from -10 to 10" - match = re.search(r'plot (.+) from (-?\d+) to (-?\d+)', command) - if match: - expr = sp.sympify(match.group(1)) - x_range = (float(match.group(2)), float(match.group(3))) - return expr, x_range - return None, None - - -def process_command(command): - try: - if "solve" in command: - equation = extract_equation(command) - return solve_equation(equation) - - elif "add" in command or "subtract" in command or "multiply" in command or "divide" in command: - numbers = extract_numbers(command) - op = 'add' if 'add' in command else 'subtract' if 'subtract' in command else 'multiply' if 'multiply' in command else 'divide' - return basic_arithmetic(op, numbers[0], numbers[1]) - - elif "factorial" in command: - n = int(extract_numbers(command)[0]) - return factorial(n) - - elif "fibonacci" in command: - n = int(extract_numbers(command)[0]) - return fibonacci(n) - - elif "differentiate" in command or "integrate" in command: - expression = extract_expression(command) - return differentiate(expression) if "differentiate" in command else integrate(expression) - - elif "sin" in command or "cos" in command or "tan" in command: - func = extract_trig_function(command) - angle = extract_angle(command) - return trigonometric_function(func, angle) - - elif "matrix" in command: - matrix_a = extract_matrix_a(command) - matrix_b = extract_matrix_b(command) - operation = extract_matrix_operation(command) - return matrix_operations(matrix_a, matrix_b, operation) - - elif "complex" in command: - operation = extract_complex_operation(command) - numbers = extract_complex_numbers(command) - return complex_operations(operation, numbers[0], numbers[1]) - - elif "convert" in command: - value, from_unit, to_unit = extract_units(command) - return unit_conversion(value, from_unit, to_unit) - - elif "plot" in command: - expr, x_range = extract_range(command) - return plot_function(expr, x_range) - - elif "statistical" in command: - data = extract_numbers(command) - return statistical_analysis(data) - - else: - return "Error: Command not recognized." - - except Exception as e: - return f"Error processing command: {str(e)}" - - -if __name__ == "__main__": - print("Testing Phase-") - print(basic_arithmetic('add', 10, 5)) # Output: 15 - print(solve_equation(sp.sympify('x**2 - 4'))) # Output: [-2, 2] - print(trigonometric_function('sin', 30)) # Output: 0.5 - print(differentiate(sp.sympify('x**3 + x'))) # Output: 3*x**2 + 1 - print(integrate(sp.sympify('x**2'))) # Output: x**3/3 - print(factorial(5)) # Output: 120 - print(fibonacci(10)) # Output: [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] - - # Example commands for testing - print(process_command("solve x**2 - 4")) # Output: [-2, 2] - print(process_command("add 10 and 5")) # Output: 15 - print(process_command("differentiate x**3 + x")) # Output: 3*x**2 + 1 - print(process_command("statistical analysis [1, 2, 3, 4, 5]")) # Output: {'mean': 3.0, 'median': 3.0, 'std_dev': 1.4142135623730951, 'variance': 2.0, 'correlation': None, 'slope': 1.0, 'intercept': 1.0} - print(process_command("plot x**3 from -10 to 10")) # Generates a plot - print(process_command("convert 10 meters to feet")) # Output: 32.8084 - -def user_input(): - while True: - print("\nWelcome to the Maths Solver!") - print("Choose the operation you want to perform:") - print("1. Basic Arithmetic (add, subtract, multiply, divide)") - print("2. Solve Equation") - print("3. Trigonometric Function (sin, cos, tan)") - print("4. Differentiation") - print("5. Integration") - print("6. Factorial") - print("7. Fibonacci") - print("8. Matrix Operations (add, subtract, multiply)") - print("9. Complex Number Operations (add, subtract, multiply, divide)") - print("10. Unit Conversion") - print("11. Plot Function") - print("12. Statistical Analysis") - print("13. Exit") - - choice = input("Enter the number of your choice: ") - - if choice == '1': - a = float(input("Enter first number: ")) - b = float(input("Enter second number: ")) - operation = input("Enter operation (add, subtract, multiply, divide): ").lower() - print(f"Result: {basic_arithmetic(operation, a, b)}") - - elif choice == '2': - equation = input("Enter the equation to solve (e.g., x**2 - 4): ") - x = sp.symbols('x') - equation_expr = sp.sympify(equation) - print(f"Solution: {solve_equation(equation_expr)}") - - elif choice == '3': - angle = float(input("Enter the angle (in degrees): ")) - function = input("Enter the trigonometric function (sin, cos, tan): ").lower() - print(f"Result: {trigonometric_function(function, angle)}") - - elif choice == '4': - expression = input("Enter the expression to differentiate (e.g., x**3 + x): ") - expr = sp.sympify(expression) - print(f"Derivative: {differentiate(expr)}") - - elif choice == '5': - expression = input("Enter the expression to integrate (e.g., x**2): ") - expr = sp.sympify(expression) - print(f"Integral: {integrate(expr)}") - - elif choice == '6': - n = int(input("Enter a number for factorial: ")) - print(f"Factorial: {factorial(n)}") - - elif choice == '7': - n = int(input("Enter the number of Fibonacci terms to generate: ")) - print(f"Fibonacci sequence: {fibonacci(n)}") - - elif choice == '8': - matrix_a = eval(input("Enter matrix A (e.g., [[1, 2], [3, 4]]): ")) - matrix_b = eval(input("Enter matrix B (e.g., [[5, 6], [7, 8]]): ")) - operation = input("Enter matrix operation (add, subtract, multiply): ").lower() - print(f"Matrix Result: {matrix_operations(np.array(matrix_a), np.array(matrix_b), operation)}") - - elif choice == '9': - a = input("Enter the first complex number (e.g., 1+2j): ") - b = input("Enter the second complex number (e.g., 3+4j): ") - operation = input("Enter complex operation (add, subtract, multiply, divide): ").lower() - print(f"Result: {complex_operations(operation, a, b)}") - - elif choice == '10': - value = float(input("Enter the value to convert: ")) - from_unit = input("Enter the from unit (e.g., meters, kilograms): ").lower() - to_unit = input("Enter the to unit (e.g., feet, pounds): ").lower() - print(f"Converted Value: {unit_conversion(value, from_unit, to_unit)}") - - elif choice == '11': - expression = input("Enter the function to plot (e.g., x**3): ") - x_range = eval(input("Enter the x-range as a tuple (e.g., (-10, 10)): ")) - expr = sp.sympify(expression) - plot_function(expr, x_range) - - elif choice == '12': - data = eval(input("Enter the data for statistical analysis (e.g., [1, 2, 3, 4, 5]): ")) - print(f"Statistical Analysis: {statistical_analysis(data)}") - - elif choice == '13': - print("Exiting the Maths Solver. Goodbye!") - break - - else: - print("Invalid choice. Please try again.") - -if __name__ == "__main__": - user_input() diff --git a/MathsSolver/test_maths_solver.py b/MathsSolver/test_maths_solver.py index a84dc9e..bd06ecf 100644 --- a/MathsSolver/test_maths_solver.py +++ b/MathsSolver/test_maths_solver.py @@ -1,5 +1,5 @@ import unittest -from MathsSolver.maths_solver import process_command, factorial, differentiate, integrate, fibonacci, plot_function #Adjust the import based on your module name +from MathsSolver.maths_solver import process_command, factorial, differentiate, integrate, fibonacci, plot_function # Adjust the import based on your module name class TestMathsSolver(unittest.TestCase): @@ -23,7 +23,7 @@ def test_process_command(self): self.assertEqual(str(process_command("differentiate x**3 + x")), '3*x**2 + 1') self.assertEqual(str(process_command("integrate x**2")), 'x**3/3') self.assertEqual(process_command("add 10 and 5"), 15) - + # Test for plot_function def test_plot_function(self): try: diff --git a/Mumbai_map.html b/Mumbai_map.html new file mode 100644 index 0000000..3f9efbf --- /dev/null +++ b/Mumbai_map.html @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/highscore.json b/highscore.json new file mode 100644 index 0000000..4288cf1 --- /dev/null +++ b/highscore.json @@ -0,0 +1 @@ +{"high_score": 4} \ No newline at end of file diff --git a/leaderboard.json b/leaderboard.json new file mode 100644 index 0000000..90a0f14 --- /dev/null +++ b/leaderboard.json @@ -0,0 +1 @@ +{"krits": {"score": 3, "high_score": 3}, "kritika": {"score": 2, "high_score": 2}, "Kritika": {"score": 2, "high_score": 2}, "Krits": {"score": 1, "high_score": 1}, "K": {"score": 3, "high_score": 3}, "K2": {"score": 1, "high_score": 1}, "k": {"score": 2, "high_score": 2}} \ No newline at end of file diff --git a/moods.json b/moods.json new file mode 100644 index 0000000..8184811 --- /dev/null +++ b/moods.json @@ -0,0 +1,26 @@ +[ + { + "mood": "happy", + "notes": "nothing. Grateful for: home. Completed positive habit" + }, + { + "mood": "calm", + "notes": "no. Grateful for: education. Didn't completed the positive habit" + }, + { + "mood": "calm", + "notes": "no. Grateful for: i learned something new. Completed positive habit" + }, + { + "mood": "stresses", + "notes": "I've a exam today. Grateful for: for food. Completed positive habit" + }, + { + "mood": "stressed", + "notes": "I've a exam today. Grateful for: for food . Completed positive habit" + }, + { + "mood": "Happy", + "notes": "no. Grateful for: food. Didn't completed the positive habit" + } +] \ No newline at end of file diff --git a/profile.json b/profile.json new file mode 100644 index 0000000..45f1c32 --- /dev/null +++ b/profile.json @@ -0,0 +1 @@ +{"Kritika": {"preferred_genre": "Romance", "reading_list": [{"title": "The Monogram Murders", "authors": ["Sophie Hannah", "Agatha Christie"], "cover_image": "http://books.google.com/books/content?id=8uYxnwEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api"}, {"title": "Cartoonists, Works, and Characters in the United States Through 2005", "authors": ["John Lent"], "cover_image": "http://books.google.com/books/content?id=zN5UAAAAMAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api"}], "reviews": {"The Mysterious Affair at Styles by Agatha Christie, Fiction, Mystery & Detective": {"rating": "4", "review": "It's good"}, "Cartoonists, Works, and Characters in the United States Through 2005": {"rating": "4", "review": "It's good"}}}} \ No newline at end of file diff --git a/satellite_image.jpg b/satellite_image.jpg new file mode 100644 index 0000000..19a2369 Binary files /dev/null and b/satellite_image.jpg differ diff --git a/satellite_image.png b/satellite_image.png new file mode 100644 index 0000000..b7be4cf Binary files /dev/null and b/satellite_image.png differ diff --git a/sudoku_gen.py b/sudoku_gen.py new file mode 100644 index 0000000..88c7765 --- /dev/null +++ b/sudoku_gen.py @@ -0,0 +1,143 @@ +import pygame +import random +import time +from colorama import Fore, Style, init + +init(autoreset=True) + +WINDOW_SIZE = 600 +GRID_SIZE = 9 +CELL_SIZE = WINDOW_SIZE // GRID_SIZE +FPS = 30 + +WHITE = (255, 255, 255) +BLACK = (0, 0, 0) +GRAY = (200, 200, 200) +LIGHT_BLUE = (173, 216, 230) +DARK_BLUE = (0, 0, 139) +RED = (255, 0, 0) + +pygame.init() + +# Create a window for the game +window = pygame.display.set_mode((WINDOW_SIZE, WINDOW_SIZE)) +pygame.display.set_caption("Sudoku Generator") +font = pygame.font.SysFont(None, 40) + +def print_grid(grid): + """Print Sudoku grid with colored output using colorama.""" + print(Fore.CYAN + "Sudoku Grid:") + for row in grid: + print(" ".join(Fore.GREEN + str(num) if num != 0 else Fore.RED + '.' for num in row)) + print(Style.RESET_ALL) + +def draw_grid(grid): + """Draw the Sudoku grid.""" + window.fill(WHITE) + + for row in range(GRID_SIZE): + for col in range(GRID_SIZE): + num = grid[row][col] + x, y = col * CELL_SIZE, row * CELL_SIZE + if num != 0: + text = font.render(str(num), True, BLACK) + window.blit(text, (x + 20, y + 10)) + + for i in range(GRID_SIZE + 1): + thickness = 5 if i % 3 == 0 else 1 + pygame.draw.line(window, BLACK, (i * CELL_SIZE, 0), (i * CELL_SIZE, WINDOW_SIZE), thickness) + pygame.draw.line(window, BLACK, (0, i * CELL_SIZE), (WINDOW_SIZE, i * CELL_SIZE), thickness) + + pygame.display.update() + +def is_valid(grid, row, col, num): + """Check if placing a number is valid.""" + for i in range(GRID_SIZE): + if grid[row][i] == num or grid[i][col] == num: + return False + + start_row, start_col = (row // 3) * 3, (col // 3) * 3 + for i in range(3): + for j in range(3): + if grid[start_row + i][start_col + j] == num: + return False + + return True + +def solve(grid, start_time=None, time_limit=5): + """Solve the Sudoku grid using backtracking with a time limit.""" + if start_time is None: + start_time = time.time() + + if time.time() - start_time > time_limit: + return False + + for row in range(GRID_SIZE): + for col in range(GRID_SIZE): + if grid[row][col] == 0: + for num in range(1, 10): + if is_valid(grid, row, col, num): + grid[row][col] = num + if solve(grid, start_time, time_limit): + return True + grid[row][col] = 0 + return False + return True + +def fill_grid(grid): + """Fill the Sudoku grid with a valid solution.""" + for _ in range(20): + row, col = random.randint(0, 8), random.randint(0, 8) + num = random.randint(1, 9) + if is_valid(grid, row, col, num): + grid[row][col] = num + solve(grid) + +def remove_numbers(grid, difficulty): + """Remove numbers from the grid based on difficulty.""" + cells_to_remove = 0 + if difficulty == 'easy': + cells_to_remove = 40 + elif difficulty == 'medium': + cells_to_remove = 50 + elif difficulty == 'hard': + cells_to_remove = 60 + + while cells_to_remove > 0: + row, col = random.randint(0, 8), random.randint(0, 8) + if grid[row][col] != 0: + grid[row][col] = 0 + cells_to_remove -= 1 + +def generate_sudoku(difficulty='medium'): + """Generate a Sudoku puzzle.""" + grid = [[0] * GRID_SIZE for _ in range(GRID_SIZE)] + fill_grid(grid) + remove_numbers(grid, difficulty) + return grid + +def main(): + difficulty = input(Fore.YELLOW + "Choose difficulty (easy, medium, hard): ").lower() + + if difficulty not in ['easy', 'medium', 'hard']: + print(Fore.RED + "Invalid difficulty! Defaulting to 'medium'.") + difficulty = 'medium' + + sudoku_grid = generate_sudoku(difficulty) + print_grid(sudoku_grid) + + running = True + clock = pygame.time.Clock() + + while running: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + running = False + + draw_grid(sudoku_grid) + clock.tick(FPS) + + pygame.quit() + +if __name__ == "__main__": + main() diff --git a/sudoku_genr.py b/sudoku_genr.py new file mode 100644 index 0000000..88c7765 --- /dev/null +++ b/sudoku_genr.py @@ -0,0 +1,143 @@ +import pygame +import random +import time +from colorama import Fore, Style, init + +init(autoreset=True) + +WINDOW_SIZE = 600 +GRID_SIZE = 9 +CELL_SIZE = WINDOW_SIZE // GRID_SIZE +FPS = 30 + +WHITE = (255, 255, 255) +BLACK = (0, 0, 0) +GRAY = (200, 200, 200) +LIGHT_BLUE = (173, 216, 230) +DARK_BLUE = (0, 0, 139) +RED = (255, 0, 0) + +pygame.init() + +# Create a window for the game +window = pygame.display.set_mode((WINDOW_SIZE, WINDOW_SIZE)) +pygame.display.set_caption("Sudoku Generator") +font = pygame.font.SysFont(None, 40) + +def print_grid(grid): + """Print Sudoku grid with colored output using colorama.""" + print(Fore.CYAN + "Sudoku Grid:") + for row in grid: + print(" ".join(Fore.GREEN + str(num) if num != 0 else Fore.RED + '.' for num in row)) + print(Style.RESET_ALL) + +def draw_grid(grid): + """Draw the Sudoku grid.""" + window.fill(WHITE) + + for row in range(GRID_SIZE): + for col in range(GRID_SIZE): + num = grid[row][col] + x, y = col * CELL_SIZE, row * CELL_SIZE + if num != 0: + text = font.render(str(num), True, BLACK) + window.blit(text, (x + 20, y + 10)) + + for i in range(GRID_SIZE + 1): + thickness = 5 if i % 3 == 0 else 1 + pygame.draw.line(window, BLACK, (i * CELL_SIZE, 0), (i * CELL_SIZE, WINDOW_SIZE), thickness) + pygame.draw.line(window, BLACK, (0, i * CELL_SIZE), (WINDOW_SIZE, i * CELL_SIZE), thickness) + + pygame.display.update() + +def is_valid(grid, row, col, num): + """Check if placing a number is valid.""" + for i in range(GRID_SIZE): + if grid[row][i] == num or grid[i][col] == num: + return False + + start_row, start_col = (row // 3) * 3, (col // 3) * 3 + for i in range(3): + for j in range(3): + if grid[start_row + i][start_col + j] == num: + return False + + return True + +def solve(grid, start_time=None, time_limit=5): + """Solve the Sudoku grid using backtracking with a time limit.""" + if start_time is None: + start_time = time.time() + + if time.time() - start_time > time_limit: + return False + + for row in range(GRID_SIZE): + for col in range(GRID_SIZE): + if grid[row][col] == 0: + for num in range(1, 10): + if is_valid(grid, row, col, num): + grid[row][col] = num + if solve(grid, start_time, time_limit): + return True + grid[row][col] = 0 + return False + return True + +def fill_grid(grid): + """Fill the Sudoku grid with a valid solution.""" + for _ in range(20): + row, col = random.randint(0, 8), random.randint(0, 8) + num = random.randint(1, 9) + if is_valid(grid, row, col, num): + grid[row][col] = num + solve(grid) + +def remove_numbers(grid, difficulty): + """Remove numbers from the grid based on difficulty.""" + cells_to_remove = 0 + if difficulty == 'easy': + cells_to_remove = 40 + elif difficulty == 'medium': + cells_to_remove = 50 + elif difficulty == 'hard': + cells_to_remove = 60 + + while cells_to_remove > 0: + row, col = random.randint(0, 8), random.randint(0, 8) + if grid[row][col] != 0: + grid[row][col] = 0 + cells_to_remove -= 1 + +def generate_sudoku(difficulty='medium'): + """Generate a Sudoku puzzle.""" + grid = [[0] * GRID_SIZE for _ in range(GRID_SIZE)] + fill_grid(grid) + remove_numbers(grid, difficulty) + return grid + +def main(): + difficulty = input(Fore.YELLOW + "Choose difficulty (easy, medium, hard): ").lower() + + if difficulty not in ['easy', 'medium', 'hard']: + print(Fore.RED + "Invalid difficulty! Defaulting to 'medium'.") + difficulty = 'medium' + + sudoku_grid = generate_sudoku(difficulty) + print_grid(sudoku_grid) + + running = True + clock = pygame.time.Clock() + + while running: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + running = False + + draw_grid(sudoku_grid) + clock.tick(FPS) + + pygame.quit() + +if __name__ == "__main__": + main() diff --git a/user567_skin_health.json b/user567_skin_health.json new file mode 100644 index 0000000..244217d --- /dev/null +++ b/user567_skin_health.json @@ -0,0 +1,12 @@ +{ + "total_exposure": 41.07, + "days": 6, + "28.1639,77.2090": { + "total_exposure": 7.27, + "days": 1 + }, + "40.7128,-74.0060": { + "total_exposure": 2.88, + "days": 1 + } +} \ No newline at end of file