Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create snakegame.py #84

Merged
merged 5 commits into from
Dec 28, 2017
Merged

Create snakegame.py #84

merged 5 commits into from
Dec 28, 2017

Conversation

salilmishra23
Copy link
Contributor

@salilmishra23 salilmishra23 commented Dec 2, 2017

Add my snake game written in python.

spm23 added 2 commits December 2, 2017 22:18
@salilmishra23
Copy link
Contributor Author

Do I need to pass all the checks to successfully merge my file ?

@prateekiiest
Copy link
Owner

yes @SPM23

@prateekiiest
Copy link
Owner

fix any one issue, the others will be fixed

@prateekiiest
Copy link
Owner

and please follow the Pull Request Template

s.fill((255, 255, 255))
xs[i]=xs[i-1];ys[i]=ys[i-1];i-= 1
if dirs==0:ys[0]+= 20
elif dirs==1:xs[0]+= 20
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

write the if statements in a new line instead of one single line.

it enhances readability of code

@@ -26,14 +26,12 @@ def die(screen, score):
if xs[0] < 0 or xs[0] > 580 or ys[0] < 0 or ys[0] > 580: die(s, score)
i = len(xs)-1
while i >= 1:
xs[i] = xs[i-1];ys[i] = ys[i-1];i -= 1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do in separate lines.
This is really not a good style

SALIL MISHRA added 3 commits December 4, 2017 01:44
@salilmishra23
Copy link
Contributor Author

Cannot remove the random number generator and nested if else as because of them the game is running smoothly. What should I do now ?

Copy link
Owner

@prateekiiest prateekiiest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all this code needs to show some output.

It doesn't do anything in the present case

@salilmishra23
Copy link
Contributor Author

The game works well on my Laptop. @prateekiiest

@prateekiiest
Copy link
Owner

I guess, it will do good if you can put the output of your code in a separate readme file under the same folder.

@salilmishra23
Copy link
Contributor Author

salilmishra23 commented Dec 20, 2017

The output of the program is this.
https://slack-files.com/T7YM27K6E-F8HBRCPC7-b65b266ca0

Now tell me what should I do get it merged.
@prateekiiest

@prateekiiest
Copy link
Owner

you need to fix the codacy/codeclimate issues first

@salilmishra23
Copy link
Contributor Author

I don't know what to use in place of random function for the food of snake.

@prateekiiest
Copy link
Owner

I am approving this code

@prateekiiest prateekiiest merged commit 32533d7 into prateekiiest:master Dec 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants