Hi ! My name is Shrawani . I am interested in Web development and also doing competitive programming.
shrawani21 / gamer_21 Goto Github PK
View Code? Open in Web Editor NEWDots & Boxes
License: MIT License
Dots & Boxes
License: MIT License
Hi ! My name is Shrawani . I am interested in Web development and also doing competitive programming.
Tell specifically how the things works also i would suggest to make live version of it
The repository URL in the git clone command is incorrect.
This discrepancy should be corrected.
Assign this issue to me, i have already sorted out the rectified URL.
Learn repos should have a LEARN.md file to teach student how to build your project step by step. You can explain how to build your project with text, code snippets, images, or even short (5 minute) long video lessons. As the maintainer of a Learn repo, the LEARN.md file requires you to think critically about how to explain the building of your project and how to also make it engaging. We don't expect you to be an expert teacher, but we would like you to reflect on how difficult it was to get to your level of knowledge, and then provide friendly guidance to help other students to learn.
Reference: https://github.com/Recode-Hive/Stackoverflow-Analysis/blob/main/Learn.md
I've noticed that this project currently doesn't have a README.md file. I'd be happy to contribute a well-structured and informative README that would significantly improve the project's clarity and usability for both new and existing contributors.
'm eager to contribute and help make this project even more user-friendly!
I want to elaborate the Readme Section of the project in order to explain the game and how to contribute
I would like to add a pull request template for this repository. I believe that having a standardized template will help streamline the contribution process, ensuring that all necessary information is included and making it easier for maintainers to review and merge pull requests.
Could you please assign this issue to me under GSSOC'24.
I would like to improve the documentary part. Can you please assign this work for me.
Thank you
Issue templates are very helpful for a collaboration repo. When users identify a bug or want to add a new feature, you can provide templates so you can collect all the pertinent information you need to fix a bug or add a new feature.
We recommend creating a “Report Bug” and “Feature Request” issue template.
you can refer this: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository
Some suggested prompts/questions you can add to a “Report Bug” template are:
Briefly describe the bug
What is the expected behavior?
Please provide step by step instructions on how to reproduce the bug
Some suggested prompts/questions you can add to a “Feature Request” issue template are:
Briefly describe your feature request
What problem is this feature trying to solve?
How do we know when the feature is complete?
Reference: https://github.com/Recode-Hive/Stackoverflow-Analysis/issues/new/choose
Click on Get Started button and copy the template to your
Description:
Implement advanced algorithms to improve the AI opponent's gameplay in single-player mode. Currently, the AI opponent provides a basic level of challenge, but enhancing its decision-making capabilities with more sophisticated algorithms can make the game more engaging and enjoyable for players.
Proposed Changes:
Expected Outcome:
By enhancing the AI opponent in single-player mode, players will have the opportunity to enjoy a more challenging and strategic gaming experience. This improvement will contribute to the overall appeal and replay value of the "Dots & Boxes" game, attracting both casual players and enthusiasts looking for a stimulating gameplay experience.
Make a live version such as a website using direct html or using python framework such as flask , so that you can showcase it to users and also add another games like this.
I would love to contribute and create you a stunning website so that others users can play it and you can also add many other games.
As the maintainer of a Collaborate repo, keeping Issues up-to-date will help the student community understand what they can do to contribute. Issues should vary by the easy (update documentation) to the difficult (add a new feature). The more involved you are, the more opportunities there are to collaborate.
Recommendations:
Add issues of varying difficulty to the repo often. you must add the tag GSSoC'24, Level 1, Level2, Level 3 good first issue etc.
How we cacluclate the Scores on Leaderboard: Every PR one point
Level 1: 10 points
Level 2: 25 points
Level 3: 45 points
Try to add some documentation issues as well it would be easy for beginner contributor to explore opensource through your repo.
Generate issues even if you plan on solving them, so the repository appears as active.
Contribute/commit often to the repo so it does not go stale.
Reference https://github.com/Recode-Hive/Stackoverflow-Analysis/issues
We recommend that every repo has a code of conduct. If you don’t feel comfortable creating your own Code of Conduct from scratch we highly recommend using one of the templates provided by GitHub. If you do use a template, please read through the template and ensure that you can and will abide by the Code of Conduct.
Please follow these instructions on how to add a Code of Conduct.
Sample: https://github.com/Recode-Hive/Stackoverflow-Analysis/blob/main/CODE_OF_CONDUCT.md
I suggest adding a code of conduct to this repo. Can you assign this to me under GSSoC'24?
As a contributor to GSSoC’24, I propose some improvements to enhance the readability and maintainability of our codebase. These improvements will make the code easier to understand, which will help us develop features more quickly and debug issues more effectively. Here are the improvements I suggest:
Modularize the Code: Break down complex functions into smaller, more manageable functions. This will make the code easier to understand and test.
Add Global Constants: Define global constants for values that are used in multiple places. This will make the code easier to maintain because we’ll only need to update these values in one place.
Add Constants for Magic Numbers: Replace magic numbers with named constants. This will make the code more readable and prevent errors that can occur when the same magic number is used in multiple places.
I believe these improvements will significantly enhance our code quality. I’m looking forward to discussing these suggestions further and hearing any additional ideas for improving our codebase.
@shrawani21 I would like to improve code readability. Could you review the issue and assign it to me?
In readme file image is not visible pls allow me to edit it and add image and its link as alternate
pls assign me this issue under label gssoc24
thank you
The repository currently lacks a CONTRIBUTING.md file, which is an important resource for guiding potential contributors on how to engage with the project effectively. A CONTRIBUTING.md file outlines the contribution guidelines, coding standards, and procedures for submitting pull requests, thus streamlining the contribution process and ensuring consistency across contributions.
Could you please assign this issue to me under GSSOC 24.
Dear Shrawani21,
The current version of the game lacks the functionality to save and load game states. Implementing this feature would greatly enhance the user experience by allowing players to continue their games from where they left off.
This feature would not only improve user engagement but also make the game more enjoyable and convenient for players.
I will work on implementing the save and load game feature to improve the overall functionality of the game.
Thank You
As a gssoc24 contributor,I want to improve gui by adding a tutorial before the game starts.Please assign this to me.
In GSSoC'24, GitHub Topics will help the discoverability of your project.
I see that you already have great topics on your repository!
I would recommend adding the name of the company like the software you use to build like "vs-code, ghdesktop" to improve your discoverability.
If you are happy with the topics you have, feel free to close this issue. 👍
I was running this on python 3.10.11 32-bit and the issue is caused by a duplicated block of code defining the Cell class and the resulting indentation errors.
I have corrected it and made following changes for "Issue1"
-Removed the duplicated definition of the Cell class.
-Ensured all necessary parts of the script are included only once and organized properly.
-Adjusted the event handling to include the keypress logic within a single loop.
-Ensured the screen is cleared only once per loop.
I have corrected it and made following changes for "Issue2"
-Fixed Text Positioning: The positions for player scores and game status messages are calculated and blitted correctly to avoid overlap.
-Game Over Screen: When the game is over, the screen is cleared, and the game over message, the winner, and the restart instructions are displayed prominently.
-Highlighting Current Turn: A visual indicator (a small rectangle) under the current player's score text highlights whose turn it is.
import pygame
SCREEN_WIDTH, SCREEN_HEIGHT = 300, 300
CELL_SIZE = 40
PADDING = 20
ROWS = COLS = (SCREEN_WIDTH - 4 * PADDING) // CELL_SIZE
WHITE = (255, 255, 255)
RED = (252, 91, 122)
BLUE = (78, 193, 246)
GREEN = (0, 255, 0)
BLACK = (12, 12, 12)
DARK_GRAY = (30, 30, 30)
LIGHT_GRAY = (100, 100, 100)
pygame.init()
win = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
font = pygame.font.SysFont('cursive', 25)
class Cell:
def init(self, r, c):
self.r = r
self.c = c
self.index = self.r * ROWS + self.c
self.rect = pygame.Rect((self.c * CELL_SIZE + 2 * PADDING, self.r * CELL_SIZE + 3 * PADDING, CELL_SIZE, CELL_SIZE))
self.edges = [
[(self.rect.left, self.rect.top), (self.rect.right, self.rect.top)],
[(self.rect.right, self.rect.top), (self.rect.right, self.rect.bottom)],
[(self.rect.right, self.rect.bottom), (self.rect.left, self.rect.bottom)],
[(self.rect.left, self.rect.bottom), (self.rect.left, self.rect.top)]
]
self.sides = [False, False, False, False]
self.winner = None
def check_win(self, winner):
if not self.winner and all(self.sides):
self.winner = winner
self.color = GREEN if winner == 'X' else RED
self.text = font.render(self.winner, True, WHITE)
return 1
return 0
def update(self, win):
if self.winner:
pygame.draw.rect(win, self.color, self.rect)
win.blit(self.text, (self.rect.centerx - 5, self.rect.centery - 7))
for index, side in enumerate(self.sides):
if side:
pygame.draw.line(win, WHITE, self.edges[index][0], self.edges[index][1], 2)
def create_cells():
cells = []
for r in range(ROWS):
for c in range(COLS):
cell = Cell(r, c)
cells.append(cell)
return cells
def reset_cells():
return None, None, False, False, False, False
def reset_score():
return 0, 0, 0
def reset_player():
return 0, ['X', 'O'], 'X', False
game_over = False
cells = create_cells()
pos, current_cell, up, right, bottom, left = reset_cells()
fill_count, p1_score, p2_score = reset_score()
turn, players, current_player, next_turn = reset_player()
running = True
while running:
win.fill(DARK_GRAY)
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
elif event.type == pygame.MOUSEBUTTONDOWN:
pos = event.pos
elif event.type == pygame.MOUSEBUTTONUP:
pos = None
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_q or event.key == pygame.K_ESCAPE:
running = False
elif event.key == pygame.K_r:
game_over = False
cells = create_cells()
pos, current_cell, up, right, bottom, left = reset_cells()
fill_count, p1_score, p2_score = reset_score()
turn, players, current_player, next_turn = reset_player()
elif not game_over:
if event.key == pygame.K_UP:
up = True
elif event.key == pygame.K_RIGHT:
right = True
elif event.key == pygame.K_DOWN:
bottom = True
elif event.key == pygame.K_LEFT:
left = True
elif event.type == pygame.KEYUP:
if event.key == pygame.K_UP:
up = False
elif event.key == pygame.K_RIGHT:
right = False
elif event.key == pygame.K_DOWN:
bottom = False
elif event.key == pygame.K_LEFT:
left = False
# Drawing grid
for r in range(ROWS + 1):
for c in range(COLS + 1):
pygame.draw.circle(win, WHITE, (c * CELL_SIZE + 2 * PADDING, r * CELL_SIZE + 3 * PADDING), 2)
# Update and draw cells
for cell in cells:
cell.update(win)
if pos and cell.rect.collidepoint(pos):
current_cell = cell
# Drawing current selection
if current_cell:
index = current_cell.index
if not current_cell.winner:
pygame.draw.circle(win, RED, current_cell.rect.center, 2)
if up and not current_cell.sides[0]:
current_cell.sides[0] = True
if index - ROWS >= 0:
cells[index - ROWS].sides[2] = True
next_turn = True
if right and not current_cell.sides[1]:
current_cell.sides[1] = True
if (index + 1) % COLS > 0:
cells[index + 1].sides[3] = True
next_turn = True
if bottom and not current_cell.sides[2]:
current_cell.sides[2] = True
if index + ROWS < len(cells):
cells[index + ROWS].sides[0] = True
next_turn = True
if left and not current_cell.sides[3]:
current_cell.sides[3] = True
if (index % COLS) > 0:
cells[index - 1].sides[1] = True
next_turn = True
# Check for win condition
res = current_cell.check_win(current_player)
if res:
fill_count += res
if current_player == 'X':
p1_score += 1
else:
p2_score += 1
if fill_count == ROWS * COLS:
game_over = True
# Switch players
if next_turn:
turn = (turn + 1) % len(players)
current_player = players[turn]
next_turn = False
# Display scores and current player
p1_img = font.render(f'{p1_score}', True, BLUE)
p2_img = font.render(f'{p2_score}', True, BLUE)
# Render player texts with appropriate positions
p1_text = font.render('Player 1:', True, BLUE)
p2_text = font.render('Player 2:', True, BLUE)
# Calculate positions for player texts and scores
p1_text_pos = (2 * PADDING, 15)
p1_img_pos = (p1_text_pos[0] + p1_text.get_width() + 5, 15)
p2_img_pos = (SCREEN_WIDTH - 2 * PADDING - p2_img.get_width(), 15)
p2_text_pos = (p2_img_pos[0] - p2_text.get_width() - 5, 15)
# Blit the player texts and scores
win.blit(p1_text, p1_text_pos)
win.blit(p1_img, p1_img_pos)
win.blit(p2_text, p2_text_pos)
win.blit(p2_img, p2_img_pos)
# Highlight current player's turn
if not game_over:
if turn == 0: # Player 1's turn
pygame.draw.rect(win, BLUE, (p1_text_pos[0], p1_text_pos[1] + font.get_height() + 2, p1_text.get_width() + p1_img.get_width() + 5, 2), 0)
else: # Player 2's turn
pygame.draw.rect(win, BLUE, (p2_text_pos[0], p2_text_pos[1] + font.get_height() + 2, p2_text.get_width() + p2_img.get_width() + 5, 2), 0)
if game_over:
# Clear screen for game over message
win.fill(BLACK)
# Display game over message
over_img = font.render('Game Over', True, WHITE)
winner_text = 'Player 1 Won' if p1_score > p2_score else 'Player 2 Won' if p2_score > p1_score else 'Tie'
winner_img = font.render(winner_text, True, GREEN)
msg_img = font.render('Press R to restart, Q or ESC to quit', True, RED)
win.blit(over_img, ((SCREEN_WIDTH - over_img.get_width()) / 2, 100))
win.blit(winner_img, ((SCREEN_WIDTH - winner_img.get_width()) / 2, 150))
win.blit(msg_img, ((SCREEN_WIDTH - msg_img.get_width()) / 2, 200))
pygame.display.update()
pygame.quit()
Hi @shrawani21 I would like to add documentation to your code, please assign this issue to me
hi @shrawani21
there is no check for out of bound accesses while updating the game state, as well as there are some unused variables in the code and i think i can improve the code reuseabilty by identifying patterns and rewriting them. please assign me this issue under gssoc 2024.
regards vansh
The README.md file should be updated in documentation and view for a proper understanding and contribution.
As a contributor to GSSoC’24, I propose some improvements to enhance the logic of our codebase. These improvements will make the code error free. Like:
Optimizing Win Detection: The current win detection checks if all four edges of a cell are filled. You could enhance this logic to check for completed squares more efficiently or to detect more complex patterns, such as larger rectangles or diagonal squares.
I am interested in contributing to the project by adding detailed instructions on how to contribute using GitHub Desktop.
I believe that by providing clear and comprehensive guidance, we can encourage more contributors to participate in the project, especially those who prefer using GitHub Desktop for their contributions.
Could you please assign me the issue related to adding GitHub Desktop contribution instructions under gssoc24? I am excited about the opportunity to contribute to the project and help streamline the contribution process for others.
When the game is started ,the player name who need to play the game is not being displayed. Also the player cannot join two adjacent points by clicking on the desired points he wish to join which is the primary functionality of the game
I just went through your code and found that a lot of global variables are missing which is causing an error to launch the UI of the game. Thus, I would like to work on this project and contribute to fix the codebase while modifying the UI of the game. I also have worked with tkinter and PyQt6 in the past, so I am fit to work this project.
👋 Hi @shrawani21,
I am Prince,web developer(Core Team) Girlscript Summer of Code. I'll be collaborating with you on preparing your repo for GSSoC'24 Program
Why are these changes required?
After Analysing last year's contributions and feedback it would be great for students to have a couple of standard readme files on the repo to understand what the project is all about and some issues detailing what they can contribute. This will help you to see increased engagement in your repository as well.
As mentioned students get a chance to learn step by step, how to build this project as well as invite mentors to collaborate and add features to this repo. I will generate issues, which will provide guidance on how to prepare your repo for Girlscript summer of code 2024.
This issue will serve as a tracking issue to track all issues related to GSSoC'24. I recommend creating a new branch for every issue and opening a pull request to track changes so we can effectively collaborate with each other and merge changes when you and I feel like those changes are ready to be merged on your primary branch.
If you have any questions or concerns, please feel free to leave a comment on this issue or any of the other issues that are generated.
I look forward to working with you
Hello, i would like to add comments in between the code to make it more readable as it would be difficult to comprehend if there are no proper comments in between the lines of code.
please assign me this task under GSSOC'24.
Thank you!
Description:
Introduce a multiplayer online mode to allow players to compete against each other remotely over the internet. By adding this feature, players can enjoy the game with friends or challenge opponents from around the world, enhancing the social and competitive aspects of "Dots & Boxes."
Proposed Changes:
Expected Outcome:
By introducing a multiplayer online mode, "Dots & Boxes" will become a more dynamic and interactive game, allowing players to engage in competitive matches and socialize with other players worldwide. This feature will expand the game's player base and provide additional opportunities for community engagement and long-term enjoyment.
The README does not provide information on how to handle potential virtual environment setups, which is a good practice to avoid dependency conflicts.
ASSIGN THIS ISSUE TO ME.
To resolve this issue, i will add a section that guides users through the process. This ensures they can set up a virtual environment, which helps avoid dependency conflicts.
Description:
I noticed that the current version of the game doesn't provide users with any background options like in "Words of Wonders: crossword" game. To resolve this issue we can provide users with different background options to choose from making the game more appealing and engaging and thereby enhance user's experience.
Expected Outcome:
This improvement will result in increase in the number of users and will also enhance user's experience.
@shrawani21 I am willing to work on this issue as a part of GSSOC'24. Please assign me this issue.
Thank you
The repository currently lacks a CONTRIBUTING.md file, which is an important resource for guiding potential contributors on how to engage with the project effectively. A CONTRIBUTING.md file outlines the contribution guidelines, coding standards, and procedures for submitting pull requests, thus streamlining the contribution process and ensuring consistency across contributions.
Could you please assign this issue to me under GSSOC 24.
Issue templates are very helpful for a collaboration repo. When users identify a bug or want to add a new feature, you can provide templates so you can collect all the pertinent information you need to fix a bug or add a new feature.
We recommend creating a “Report Bug” and “Feature Request” issue template.
you can refer this: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository
Some suggested prompts/questions you can add to a “Report Bug” template are:
Briefly describe the bug
What is the expected behavior?
Please provide step by step instructions on how to reproduce the bug
Some suggested prompts/questions you can add to a “Feature Request” issue template are:
Briefly describe your feature request
What problem is this feature trying to solve?
How do we know when the feature is complete?
Reference: https://github.com/Recode-Hive/Stackoverflow-Analysis/issues/new/choose
Click on Get Started button and copy the template to yours.
Description:
Enhance the gaming experience by introducing a single-player mode with AI opponents of varying difficulty levels. By incorporating this feature, players can enjoy challenging matches against computer-controlled opponents, catering to both casual players and those seeking more competitive gameplay in "Dots & Boxes."
Proposed Changes:
Expected Outcome:
By introducing a single-player mode with adjustable difficulty levels and AI opponents, "Dots & Boxes" will offer a versatile and engaging gaming experience for players of all skill levels. This feature will provide opportunities for solo gameplay and skill development while maintaining a high level of replayability and enjoyment. Additionally, players can challenge themselves with increasingly difficult opponents or relax with a more casual gaming experience, catering to a diverse audience of players.
The current UI is easy but how to mark your chance is confusing for the users, as even I found it difficult to navigate. Adding clear instructions on how to use the UI will greatly improve the player's experience and make the game more efficient to play. For example, providing rules on how to make a move, start the game, and navigate through the menus would be beneficial. Currently, understanding how to begin playing the game is not straightforward, as I also need to read through the code to figure it out. By adding instructional prompts and intuitive design elements, players can easily grasp how to interact with the UI and enjoy the game without confusion. As a contributor to GSSoC’24 I'd be happy to contribute to enhancing the UI and making it more accessible for players.
I've just opened up an issue in the repository regarding adding some new features and polishing up the UI of the game. Specifically, I'm looking to implement Single Player and Multiplayer modes, a customizable grid option, and score tracking. I'm really excited about this and I think I can do a great job with it.
#gssoc level 1
#gssoc level2
#gssoc level3
Dear Maintainer @shrawani21
I have discovered a significant error in the README file that must be addressed immediately. The README claims that the Dot and Boxes game is developed using ReactJS, HTML, and CSS. However, this is blatantly incorrect. The entire project is actually written in Python and uses the Pygame library, not ReactJS.
Here’s the misleading excerpt from the README:
Developed using React.js, HTML, and CSS.
This discrepancy is misleading and could cause considerable confusion for developers and users alike. It is crucial to rectify this mistake to maintain the project's credibility and to ensure that contributors and users have accurate information about the technology stack.
Update the README file to correctly state that the project uses Python and Pygame.
Remove any incorrect references to ReactJS, HTML, and CSS.
Review the entire README for any other inconsistencies or errors.
This is not just a minor typo; it’s a fundamental misrepresentation of the project's architecture. Accurate documentation is essential for the open-source community, and this mistake undermines trust.
Please prioritize this correction.
A Requirements file is required since after cloning the repository we cannot run it without the needed requirements.
Please assign me this issue.
GSSOC 2024
There is a noticeable contrast issue between the font color and the background color on the webpage, which is impacting the readability and overall user experience.
The font color should complement the background, ensuring that the text is easily readable and aesthetically pleasing. Ideally, there should be a high contrast between the text and the background for better accessibility.
The current font color blends in too closely with the background color, making it difficult for users to read the text
The current version of code have bugs, to ensure proper working it needs some work. It doesn't show which player's turn it is, so need to make sure it shows that.
I have requested a pull request with solution for the same.
Greeting PA,
The current README.md file is not correctly formatted.
Assign me this issue under GSSOC 24.
Thank you
I propose to create a GitHub workflow named "Greetings". This workflow will automatically greet users who create new issues or pull requests in this repository. The Greeting will look like "Hi there! Thanks for opening this issue. We appreciate your contribution to this open-source project. We aim to respond or assign your issue as soon as possible."
Please assign this issue to me
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.