Page 24 of 26 FirstFirst ... 142223242526 LastLast
Results 231 to 240 of 253

Thread: My python one-liner scramble generator

  1. #231
    Member
    Join Date
    Apr 2007
    WCA Profile
    2007GOUL01
    YouTube
    cardologist
    Posts
    4,298

    Default

    Odder.. edit your post =D
    #

  2. #232

    Default

    Quote Originally Posted by Odder View Post
    Because of this line:
    if n != o
    you claim o=0 in the beginning, so n cannot be 0 for the first run, therefore you'll never get position 0 (R move) for the first move
    Is that some weird Ruby stuff I don't know? I'd say n=m.at(rand(6)) never gets you n=0, just n="R". So that shouldn't be a problem.

  3. #233
    Member Owen's Avatar
    Join Date
    Nov 2009
    Location
    New York
    WCA Profile
    2010LENN01
    YouTube
    TheOatCuber
    Posts
    984

    Default

    I think so, because my original code generated scrambles beginning with R on multiple occasions.

  4. #234
    Member Odder's Avatar
    Join Date
    Feb 2009
    WCA Profile
    2008ANDE02
    YouTube
    Minxer2011
    Posts
    1,403

    Default

    Quote Originally Posted by Stefan View Post
    Is that some weird Ruby stuff I don't know? I'd say n=m.at(rand(6)) never gets you n=0, just n="R". So that shouldn't be a problem.
    Quote Originally Posted by Owen View Post
    I think so, because my original code generated scrambles beginning with R on multiple occasions.
    I'm no good at Ruby Ruby is retarded xD I'was god damn sure that rand(6) generated 0-5 -.-' (I generated like 30 scrambles without a leading R move :O )


    EDIT:

    Chen Shuang:
    Your distribution is wrong..
    Code:
    U->L=25%
    D->L=20%
    Last edited by Odder; 01-03-2012 at 04:58 AM.

  5. #235

    Default

    Quote Originally Posted by Odder View Post
    I'was god damn sure that rand(6) generated 0-5
    And it probably does. But the code says n=m.at(rand(6)), not n=rand(6).

  6. #236
    Member Odder's Avatar
    Join Date
    Feb 2009
    WCA Profile
    2008ANDE02
    YouTube
    Minxer2011
    Posts
    1,403

    Default

    Quote Originally Posted by Stefan View Post
    And it probably does. But the code says n=m.at(rand(6)), not n=rand(6).
    Ohh ****... Can you tell me the best place to hide? (I had already changed his code inside my head when I commented his code... stupid Odder)

  7. #237
    Member
    Join Date
    May 2008
    Location
    China
    WCA Profile
    2008CHEN27
    Posts
    34

    Default

    Its algorithm can be describe as:
    generate random moves
    and then check it, let RR->R, LL->L, RL->LR, and UD, FB as well
    is it really wrong?

  8. #238
    Member Odder's Avatar
    Join Date
    Feb 2009
    WCA Profile
    2008ANDE02
    YouTube
    Minxer2011
    Posts
    1,403

    Default

    Quote Originally Posted by qq280833822 View Post
    Its algorithm can be describe as:
    generate random moves
    and then check it, let RR->R, LL->L, RL->LR, and UD, FB as well
    is it really wrong?
    I'm pretty confident that I'm right. But I'm already looking for a place to hide when you prove me wrong.

    (a=rand 6)!=b&&a!=b+3

    same as:
    a!=b and a!=b+3

    well, a!=b is obvious..

    a!=b+3 can be described like this:
    setA=[U,R,F], setB=[D,L,B]
    then we have: setA[x]+3=setB[x], where x is the position.
    but setB[x]+3 != setA[x].... (as 5+3 != 2)
    this means that for any moves in setA, there is 4 valid next-moves, but for setB we have 5.

    The goal for the scrambles is to have:
    5 valid moves, unless we have just had two opposite moves in a row, then it should be 4
    Last edited by Odder; 01-03-2012 at 05:17 AM.

  9. #239
    Member
    Join Date
    May 2008
    Location
    China
    WCA Profile
    2008CHEN27
    Posts
    34

    Default

    why should valid moves of setA be the same as of setB
    if we only allow "LR" but disallow "RL", of course setA is difference to setB...

  10. #240
    Member Odder's Avatar
    Join Date
    Feb 2009
    WCA Profile
    2008ANDE02
    YouTube
    Minxer2011
    Posts
    1,403

    Default

    Imagine you have the move R

    R doesn't allow the next move to be L, therefore you can't get RL.. (RL is not converted to LR) (which leaves 4 valid moves only)

    now take L

    L does allow the next move to be R... (5 valid moves, YAY!! )
    Last edited by Odder; 01-03-2012 at 05:24 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •