jblog
toc

Easter MMXVII

2017-04-16, post № 167

art, ascii, haiku, poetry, #ascii egg, #celebration, #easter egg, #egg

Winds swirl through the air,
Water sloshes at the shore;
A peaceful island.

                           vunnnnnnnxvvczYX                         
                       uuxrjjft///tfjrnuvvcXXUU                     
                    cuxxrf/\|(|||/tttrnxuuvcczYYJL                  
                 cuuvnxrjt/\\\/\//tffrxnuvvcccXXYYCLC               
               cccvuunxjrttttttjjfrrxnnnvvcczXzXUUUJL0              
             cczvvvuuuxnrxrrrjrxrxnnuuuvvcczXXXXYXUJJLQZ            
           czzzXzvccvnuunnnnnnnnuuuvuvvccczzzXYXYUYUJCLQO           
          zzzzXzccvvvvvuunnnnunuunnuuucvzczzXXYXUYJUJJCQ0Oq         
         XXXXzzzzcccvvvvuuvunnnnnuuuvvvcczzXzXYXXYYUUCCL0Qmp        
        XXXzXzzzzzcccccvuunnnnnnnnunvucvzzzXzYXXYUUUUJJCL0OZq       
       XYYYYXXzczzzcczcvuuunxxnxxxnuuuvzzXXXXYXUYUUUUUCJCQ0Owp      
      YYUYXYYXXXXzczczcvvuunxxrrrxnnuvuzzzzXXXYYUUUUUUJJCCL0Omd     
     YYUUYUYUXXXXczzzzcvvvunxrxrrrxxnuvcczzXzYYXYXUYUUJJLQQ0OZmk    
    YUUJJJYUYYXUXYXzczzczuuxrjrrrjrxxccccczzXXXYUYUYUJUCCCL00mwdw   
    UJCJJJUYXYXXXzzXXzzvvnxxrjjjrjxxuvvczXzXYYYXXUYUUUJCJLLL0Zmpb   
   CLLCJJJCUUUXUUXXzzzccvvunxxrrxrnuuvzzzXYXXYYYUUUYJUJJJJLL0OZwda  
   QLQLCJCUUUUUUYYXXXXXzvuuxxxrrnxxuuvvccXzXYUYUYYYUUUUCCCLLQ0Zmpk  
  00QQLLLCUJUUUUUYYYXzzzccvuuxxxxnnuvczzcXXXXUUUUYYJUYUUJCLL0QOwqk* 
  Z0OQQLLJCJUUUYUYYYXXXzzcvvnunnuuvvvvczzzXXXYYYYUY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Zmppboo   
    MWohhdpwqwwmwOZZZOOO00QLQLQQLLLLLCCCLLLCLCLCLLJLLQ0ZOmmwdbaa    
     &W#hkbpqwqwqZZZZZZO000QQQ0QLLQLCLLCQCLQLLLLCLLQQL0ZZmwpbkap    
      8&#ohkbddpqwwmmmZOZOOO0OO0Q0Q0QLLQQLQLLQQ0QQQ00ZOmmqbdha      
       88WMohobdbpqpwwmqZZmZZZOQZO000Q0OQQQ00QQQ000OZmmqppkk*       
        M%8M#*okkbppdqqppmwZmmmwOOZZOO00O0O0O0O0OmZqqwqdbkho        
          B@8&M**ohkbbdqppqwqwwwwwZZZmZmOOOOOZZmmwwppbbkka          
            @@8&MW*ookkkbdpdpdqpqqwqpwZwZwwmqwqpppdpdkk*            
              $$%%&WM#*oahkkhkddppdpbqwpppppbpdkkbbhho              
                @$@B8&WM**#aoaahbkkhkhkbbkkbhhkhkkab                
                   $@%%8&WWM#M#*o**oooaoooaaaaook                   
                       @%%W&WWW#*##o*oa#**#M*                       
                             #88&&%8%&                              

T-3PO — Tic-Tac-Toe Played Optimally

2017-04-08, post № 166

games, HTML, JavaScript, mathematics, programming, Python, #computer player, #game ai, #perfect, #perfect play, #three in a row, #three to win, #three

Tic-Tac-Toe, noughts and crosses, Xs and Os, three in a row or whatever you want to call it may be the simplest perfect information game that is enjoyable by humans. Two players set their pieces (X or O) on an 𝟥 ⨉ 𝟥 grid, alternating their turns. The first player to get three of their pieces in a line, wins. If no player succeeds to get a line, the game ends in a draw.

Tic-Tac-Toe’s simplicity may become clear, if you consider that skilled players — people who have played a few rounds — can reliably achieve a draw, thereby playing perfectly. Two perfect players playing Tic-Tac-Toe will — whoever starts — always tie, so one may call the game virtually pointless, due to there practically never being a winner.
Because of its simple rules and short maximal number of turns (nine) it is also a game that can be solved by a computer using brute-force and trees.

The first Tic-Tac-Toe-playing program I wrote is a Python shell script. It lets you, the human player, make the first move and then calculates the best possible move for itself, leading to it never loosing. On its way it has a little chat whilst pretending to think about its next move. The Python source code can be seen below or downloaded here.

The second Tic-Tac-Toe-playing program I wrote uses the exact same method of optimizing its play, though it lets you decide who should begin and is entirely written in JavaScript. You can play against it by following this link.

Both programs look at the entire space of possible games based on the current board’s status, assumes you want to win and randomly picks between the moves that either lead to a win for the computer or to a draw. I did not include random mistakes to give the human player any chance of winning against the computer. Other Tic-Tac-Toe-playing computers, such as Google’s (just google the game [1]), have this functionality.

Source code: t-3po.py

Second Anniversary

2017-03-28, post № 165

art, #2 years, #celebration, #collage, #j, #J-Blog, #jblog, #two years

J-Blog celebrates its second anniversary!
Exactly two years ago, on the twenty-eighth of March 2015, the very first post on this blog appeared, appropriately named “Hello World”. Since then, including this one, 𝟣𝟨𝟦 other posts have been posted. Here a few of the image highlights from both years, with their corresponding post.

                     -   
            ?][)0Zqpkdc  
         QmphM&88888%av  
        Z&88%%%8M*%B8X   
       JW&Mbw\1] ZB@b    
       ?-        #BB%c   
                 m@@@kc  
                 ?o@BBC  
                  ]&@@*v 
                   L%@%Y 
                    o@BZ 
                    LB@a 
                    ]%BM?
                     *B&v
                     k%&v
                     mBWv
                     wBWv
                     ZB* 
                     w@O 
                     W8z 
                    [BO  
                    ao]  
Ckc                k&z   
b@#Z?            [a8L    
X%$@*Q[?      ?[q%&}     
 {&%%8&kwm00mdM%%w?      
  ?ZW8%%%%%%B8&q]        
    -}\wpkpft[           
Jonathan Frech's blog; built 2021/04/16 20:21:20 CEST