Python 2.7.1 (r271:86832, Mar 20 2011, 15:40:35)
[GCC 4.4.1] on linux2
    !h - for getting help
    !l - for getting learn
                    
>>> Console open console max
Stop
Loading...

Lines light


 

    The game starts with a 9×9 board with three balls chosen out of seven different colors. The player can move one ball per turn.

    The goal is to remove maximum quantity of
    balls by forming the lines (horizontal, vertical
    or diagonal) of at least five balls of the same
    color.
    The goal is to remove maximum quantity of balls by forming the lines (horizontal, vertical or diagonal) of at least five balls of the same color. Lines of 5 or more balls of the same color are eliminated, adding to the score, and player gains one turn, i.e. he can move another ball. If not, three new balls are added, and the game continues until the board is full.

     

 

The difference between light version and original is in the player’s possibility to place a ball into any free place.

 

Solution of the following tasks can be helpful: Find sequence

Here is how your function will be executed:

 

checkio({
    'steps':[[1,1],[1,2]], #list of coordinates for last game iteration
    'colors':[1,3,5],  #list of ball (possible values is 1..9) colors 
                       #for next iteration
    'map':[[0,1, ....], .... ], #current map is array of arrays.
                                #0 - empty place, 1..9 - with ball
    'clear':[[2,3],], #array or coordunates, wich was removed from map
    'score': 50, #your current score
    'all_colors':7 # count of all possible colors. 
                         # Increase after every 200 scores.
})

Your function "checkio" must return an array of 2 arrays - coordinates of movement

[[1,2]
[3,4]] # move ball from 1,2 to 3,4

36 comments...

Lom
Lom
 
Followers count3 Rank687

  #
Hey, anyone was able to get game playing?
Downloadable version plays offline for like 400-1200 moves (depending on random) but I do not able to get online version working. Is there any problem with the server?
Lom
Lom
 
Followers count3 Rank687

  #
Okay, now I see 504 gateway timeout.
Lom
Lom
 
Followers count3 Rank687

  #
Okay, I have narrowed down the problem.
If I remove all logic from game it plays nice, cause it finishing withing timeout. However, logic is heavy, so game cannot finish playing during allowed timeframe, so I get 504 error.
Can someone please give more details about how much time/cpu power solution can use?
Or, preferable, is there any possibility to play game one move at a time? So checker will not try to get full session results, but do one iteration in a run.
Lom
Lom
 
Followers count3 Rank687

  #
This is real problem, the more successful solution is, the more time it take for server to play all those moves, so the more possible timeout. I have to hinder my solution now, so at least I'm getting some scores.
oduvan
 
Followers count8 Rank891

  #
Thank you for your attention. We are preparing a new release of checkio. In wich we will fix all timeout problems.

This release we plan in 1-2 weeks already.
Lom
Lom
 
Followers count3 Rank687

  #
Thanks! I really want to know will my solution beat yours or not. On local play average is 600-700, with peak of 1500+ moves now ;)

And keep a good work!
oduvan
 
Followers count8 Rank891

  #
Mean while you can try to make  a local solution for competition game.

What do you think about it?
Lom
Lom
 
Followers count3 Rank687

  #
Local solution playing well. What do you mean about competition game?
oduvan
 
Followers count8 Rank891

  #
http://www.checkio.org/catalog/competitions/
bryukh
 
Followers count4 Rank1898

  #
it will be interesting. :)
Lom
Lom
 
Followers count3 Rank687

  #
Long time since I been here.
I noticed, that now there is no time-out problems.
I enhanced my solution a bit, now watch it playing.
The score is 2026 already, and I wonder when it will loose :)

However, I found a stupid bug in the code and will have to play once again when I fix it.

I have one question though: solutions for the competition games are closed? Is there any way to compare other people code with mine? This could be interesting.
oduvan
 
Followers count8 Rank891

  #
The only way to compare solutions is "Play for top".

In competitions you can play between programs
Lom
Lom
 
Followers count3 Rank687

  #
Well, I left game playing for the night.
However, something went wrong and all freeze.
Results not get to the site :)

Please check:

http://imageshack.us/photo/my-images/12/resultcr.jpg/

oduvan
 
Followers count8 Rank891

  #
5735! You are monster :) ! Im checking. thanks for your report
oduvan
 
Followers count8 Rank891

  #
I sent you a mail. Can we continue our discrission in mail?
oduvan
 
Followers count8 Rank891

  #
is your mail from profile correct?
Lom
Lom
 
Followers count3 Rank687

  #
Yes, I sent you reply already.
Lom
Lom
 
Followers count3 Rank687

  #
Okay, so I have the problem :)
After polishes and fixes my solution can play this game for a very long time. And there is big chance that either server will halt/give 500 error or something else happened.

Is it possible to add current score to callback?
So I can halt it on any score that I want?
oduvan
 
Followers count8 Rank891

  #
'score' is one of keys of input dict. I'll change a task description
bryukh
 
Followers count4 Rank1898

  #
see referee.py line 180-188. You forget to return SCORE )))
oduvan
 
Followers count8 Rank891

  #
You right. Thank. I fixed. You can redownload with new referee.
bryukh
 
Followers count4 Rank1898

  #
after first score all end )))
bryukh
 
Followers count4 Rank1898

  #
I agree. I get > 4000 points and my internet connection fall. :(
Lom User 687 's comment has been removed by admin. #  
bryukh
 
Followers count4 Rank1898

  #
12000 and it's may be forever ))) Need limit for score.
Lom
Lom
 
Followers count3 Rank687

  #
Left game for weekend - 34000+ and error again.
Maybe you should set limit? Like 10000 is enough?

Or, add one more colour every 1000 score? So there will be end of the game.
oduvan
 
Followers count8 Rank891

  #
One more color is a really good idea. But not 1000 :) Faster...

Thank you.
bryukh
 
Followers count4 Rank1898

  #
1000 is good. Less score is very easy.
oduvan
 
Followers count8 Rank891

  #
Or maybe smaller board?
bryukh
 
Followers count4 Rank1898

  #
Agree - 1000 is enough.
Lom
Lom
 
Followers count3 Rank687

  #
I think additional colours will definitely stop the game in the long run.

Also, as I understand, right now every other game for the top uses different random seed. Have you considered using same seeds, so all solutions will be in the same positions?

Maybe top game should be played against 10 such seeds, so no hard-coded solutions.
bryukh
 
Followers count4 Rank1898

  #
I think additional colors is nice idea.
bryukh Tester 1898 's comment has been removed by author. #  
oduvan
 
Followers count8 Rank891

  #
We are working already on new version. We plan to show us a new today. With a many small fixes.

thank you for your attention
oduvan
 
Followers count8 Rank891

  #
We done. Let's Play!!!! :)
oduvan
 
Followers count8 Rank891

  #
No, we use one seed for all top games. When you play top game we run your program 2 times.

http://clip2net.com/clip/m81657/1326711793-cliphyc245-47kb.png

First os always different, but the second is always the same.

Only authorized users can reply. Login

Facebook Linkedin Twitter GoogleGroups email and gtalk FeedBurner | Help | How to help | Contact us | About us | Get Widget | Live help