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

Tiles disappear #1

Closed
skull-squadron opened this issue Mar 20, 2014 · 13 comments
Closed

Tiles disappear #1

skull-squadron opened this issue Mar 20, 2014 · 13 comments
Assignees

Comments

@skull-squadron
Copy link

Might have to do with combining them, moving up and to the right.

Otherwise, neat.

@davidmturner
Copy link

Here's an example. From this state:

/------|------|------|------\
|      |      |    2 |      | 
|------|------|------|------|
|      |      |      |      | 
|------|------|------|------|
|      |      |      |      | 
|------|------|------|------|
|      |      |      |    4 | 
\------|------|------|------/

One move right, results in:

/------|------|------|------\
|      |      |      |      | 
|------|------|------|------|
|      |      |      |      | 
|------|------|------|------|
|      |    2 |      |      | 
|------|------|------|------|
|      |      |      |    4 | 
\------|------|------|------/

@srolfe
Copy link

srolfe commented Mar 20, 2014

Seems to mostly be with left / right movements. Up and down mostly work, but sometimes it seems like new tiles may disappear.

@alexflint
Copy link

I am experiencing the same thing.

@rpicard
Copy link

rpicard commented Mar 20, 2014

+1 on OS X if it matters.

@pierrei
Copy link

pierrei commented Mar 20, 2014

Same thing for me..

@JosefZIla
Copy link
Owner

I have tried a few times, but still have trouble reproducing this, can you please run new version with something like:
./bash2048.sh -l game.log

and then paste the relevant part of log file here?

@JosefZIla JosefZIla self-assigned this Mar 20, 2014
@razasyedh
Copy link

I'm on OSX also. In this example the 4 disappears and so does a 2:

Board status:
     |      |      |      | 
     |      |      |      | 
   4 |    2 |      |      | 
   2 |      |      |    2 | input: left key
move piece with value 4 from [8] to [7]
joined piece from [7] with [7], new value=0[7]
move piece with value 2 from [9] to [8]
move piece with value 2 from [12] to [11]
joined piece from [11] with [11], new value=0[11]
move piece with value 2 from [15] to [12]
Board status:
     |      |      |      | 
   2 |      |      |      | 
   2 |      |      |      | 
   2 |      |      |      | 

@rainydan
Copy link

Here's my repro. For clarity you might want to add '2 appears in [x]' events to the log.

Board status:
     |      |    2 |      | 
     |      |    2 |      | 
     |      |      |      | 
     |      |      |      | input: down key
move piece with value 2 from [6] to [14]
joined piece from [2] with [14], new value=4
Board status:
     |      |      |      | 
     |      |      |      | 
     |      |    2 |      | 
     |      |    4 |      | input: right key
move piece with value 2 from [10] to [11]
move piece with value 4 from [14] to [15]
move piece with value 2 from [11] to [12]
joined piece from [12] with [12], new value=0
Board status:
     |      |    2 |      | 
     |      |      |      | 
     |      |      |      | 
     |      |      |    4 | 

@skull-squadron
Copy link
Author

push_pieces when $4 = "up" or "right" is where most the crunchiness lies.

Makes one want to do TDD for bash. :)

@skull-squadron
Copy link
Author

Bash 2048 v1.0 RC1 (bugs: https://github.com/mydzor/bash2048/issues) pieces=2 target=2048

/------|------|------|------\
|      |    2 |      |      |
|------|------|------|------|
|      |      |      |      |
|------|------|------|------|
|    2 |      |      |      |
|------|------|------|------|
|      |      |      |      |
\------|------|------|------/

->

/------|------|------|------\
|      |    2 |      |      |
|------|------|------|------|
|      |      |      |      |
|------|------|------|------|
|      |      |      |      |
|------|------|------|------|
|      |      |      |      |
\------|------|------|------/

Oops, that's like 2 bugs.

  • Top 2 didn't move to right side.
  • Second 2 dropped off the universe.

@skull-squadron
Copy link
Author

Is this a bash debugging interview? ; )

@JosefZIla
Copy link
Owner

it seems that these problems only happen on Macs and from reproductions I see that for some reason seq command does not work the same way as in linux, I replaced seq with bash function for generating sequential lists. Can someone verify if it works now? (Unfortunately, I dont know anyone with mac in my vicinity)

@davidmturner
Copy link

Looks good to me!

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

No branches or pull requests

9 participants