Share to: share facebook share twitter share wa share telegram print page

0x88

The 0x88 chess board representation is a square-centric method of representing the chess board in computer chess programs. The number 0x88 is a hexadecimal integer (13610, 2108, 100010002). The rank and file positions are each represented by a nibble (hexadecimal digit), and the bit gaps simplify a number of computations to bitwise operations.

Layout

In the 0x88 board representation, the layout is spread out to cover an 8-by-16 board, equal to the size of two adjacent chessboards. Each square of the 8-by-16 matrix is assigned a number as can be seen in the board layout table. In this scheme each nibble represents a rank or a file, so that the 8-bit integer 0x42 represents the square at (4,2) in zero-based numbering, i.e. c5 in standard algebraic notation.[1]

Adding 16 to a number for a square results in the number for the square one row above, and subtracting 16 results in the number for the square one row below. To move from one column to another the number is increased or decreased by one.[2] In hexadecimal notation, legal chess positions (A1-H8) are always below 0x88. This layout simplifies many computations that chess programs need to perform by allowing bitwise operations instead of comparisons.[3]

0x88 board layout[1]
0x00 (a) 0x01 (b) 0x02 (c) 0x03 (d) 0x04 (e) 0x05 (f) 0x06 (g) 0x07 (h) 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F
0x70 (8) 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
0x60 (7) 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
0x50 (6) 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
0x40 (5) 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
0x30 (4) 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
0x20 (3) 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
0x10 (2) 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
0x00 (1) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

Algebraic notation and conversion

Squares on a chess board with algebraic notation

The modern standard to identify the squares on a chessboard and moves in a game is algebraic notation, whereby each square of the board is identified by a unique coordinate pair — a letter between a and h for the horizontal coordinate, known as the file, and a number between 1 and 8 for the vertical coordinate, known as the rank.

In computer chess, file-rank coordinates are internally represented as integers ranging from 0 to 7, with file a mapping to 0 through to file h mapping to 7, while the rank coordinate is shifted down by one to the range 0 to 7.

An advantage of the 0x88 coding scheme is that values can be easily converted between 0x88 representation and file-rank coordinates using only bitwise operations, which are simple and efficient for computer processors to work with. To convert a zero-based file-rank coordinate to 0x88 value:

Thus, a1 corresponds to , with all 8 of the bits set to , b2 corresponds to , and h8 corresponds to .[1]

To convert an 0x88 value to a file-rank coordinate pair:

Note: In the above formulas, << and >> represent left and right logical bit shift operations respectively while & represents bitwise and.

Applications

Off-the-board detection

Off-the-board detection is a feature of chess programs which determines whether a piece is on or off the legal chess board. In 0x88, the highest bit of each nibble represents whether a piece is on the board or not. Specifically, out of the 8 bits to represent a square, the fourth and the eighth must both be 0 for a piece to be located within the board.[4] This allows off-the-board detection by bitwise and operations. If $square AND 0x88 (or, in binary, 0b10001000) is non-zero, then the square is not on the board.[5] This bitwise operation requires fewer computer resources than integer comparisons. This makes calculations such as illegal move detection faster.[5]

Square relations

The difference of valid 0x88 coordinates A and B is unique with respect to distance and direction, which is not true for classical packed three-bit rank and file coordinates. That makes lookups for Manhattan distance, possible piece attacks, and legal piece moves more resource-friendly. While classical square coordinates in the 0–63 range require 4K-sized tables (64×64), the 0x88 difference takes 1/16 that or 256-sized tables—or even 16 less.[6]

An offset of 119 (0x77 as the maximum valid square index) is added, to make ±119 a 0–238 range (a size of 240 for alignment reasons).[6]

0x88Diff = 0x77 + A − B

Adoption

Though the 0x88 representation was initially popular, it has been mostly replaced by the system of bitboards.[7]

References

Works cited

  • Hyatt, Robert (2013). "Chess program board representations". Archived from the original on 12 February 2013. Retrieved 6 March 2020.
  • Reul, Fritz Max Heinrich (2009). New architectures in computer chess (Thesis). Gildeprint, TICC Dissertation Series 6. ISBN 9789490122249.
  • Østensen, Emil Fredrik (Autumn 2016). University of Oslo (PDF) (Master in programming and networks thesis). University of Oslo.
  • Moreland, Bruce (2007-07-16). "0x88 Move Generation". Archived from the original on 2007-07-16. Retrieved 2020-03-12.
  • Schalk, Andrea (August 7, 2008). "COMP30191 The Theory of Games and Game Models" (PDF). University of Manchester Department of Computer Science. Retrieved 2020-03-18.
  • Keen, Ben (November 2009). "A History of Computer Chess" (PDF). Laboratoire Bordelais de Recherche en Informatique. Archived from the original (PDF) on 2020-03-23. Retrieved 2020-03-23.
  • Dailly, Paul; Gotojuch, Dominik; Henning, Neil; Lawson, Keir; Macdonald, Alec; Tajaddinov, Tamerlan (March 18, 2008). "Chess Mantis A Chess Engine". Retrieved 2020-03-23.

Read other articles:

Irises, Vincent van Gogh Bunga-bunga Iris Vincent van Gogh, 1889 Cat minyak di atas kanvas, 71×93 cm (28×37 in) J. Paul Getty Museum, Los Angeles, California Bunga-bunga Iris adalah nama sebuah lukisan karya pelukis Vincent van Gogh. Merupakan satu dari sekian karyanya ketika ia berada di R.S. Jiwa Saint Paul-de-Mausole di Saint-Rémy-de-Provence, Prancis pada saat-saat terakhir menjelang kematiannya tahun 1890. Lukisan tersebut kemungkinan dipengaruhi oleh lukisan kayu Jepang, seperti ke…

Artikel ini tidak memiliki referensi atau sumber tepercaya sehingga isinya tidak bisa dipastikan. Tolong bantu perbaiki artikel ini dengan menambahkan referensi yang layak. Tulisan tanpa sumber dapat dipertanyakan dan dihapus sewaktu-waktu.Cari sumber: SMK Binakarya Mandiri 2 Bekasi – berita · surat kabar · buku · cendekiawan · JSTOR SMK BKM 2 Bekasi Jawa BaratInformasiDidirikan01 Juli 2005AkreditasiA+Nomor Pokok Sekolah Nasional20257422Kepala Sekola…

Pisano commune di Italia Pisano (it) Tempat categoria:Articles mancats de coordenades Negara berdaulatItaliaRegion di ItaliaPiedmontProvinsi di ItaliaProvinsi Novara NegaraItalia Ibu kotaPisano PendudukTotal803  (2023 )GeografiLuas wilayah2,77 km² [convert: unit tak dikenal]Ketinggian390 m Berbatasan denganArmeno Colazza Meina Nebbiuno SejarahHari liburpatronal festival (en) Santo pelindungEusebius of Vercelli (en) Informasi tambahanKode pos28010 Zona waktuUTC+1 UTC+2 Kode telepon0322…

Bacukiki BaratKecamatanNegara IndonesiaProvinsiSulawesi SelatanKotaPareparePemerintahan • CamatAndi Erwin Pallawarukka, S.STP, M.SiPopulasi • Total39,329 jiwa jiwaKode Kemendagri73.72.04 Kode BPS7372011 Luas- km²Desa/kelurahan6 Bacukiki Barat adalah sebuah kecamatan di Kota Parepare, Sulawesi Selatan, Indonesia. Wilayah administratif Peta administrasi kecamatan bacukiki barat Kecamatan Bacukiki Barat termasuk salah satu kecamatan di Kota Parepare. Wilayah Kecamatan …

Komisi Pengawas Nasional Republik Rakyat Tiongkok中华人民共和国国家监察委员会Zhōnghuá Rénmín Gònghéguó Guójiā Jiānchá WěiyuánhuìKantor pusat Komisi Pengawas Nasional diJalan Ping'anli Barat 41, Distrik Xicheng, BeijingNamaKomisi Pengawas NasionalIkhtisarDibentuk23 Maret 2018Struktur yurisdiksiLembaga nasionalTiongkokWilayah hukumTiongkokMarkas besarBeijing, TiongkokPejabat pemerintahYang Xiaodu, Direktur Komisi Pengawas NasionalSitus webCCDI & NSC official website…

Antena pecut di sebuah mobil. Antena pecut[1] (Inggris: whip antennacode: en is deprecated ) adalah sebuah antena yang berbentuk sebuah kawat atau batang yang lurus tapi fleksibel. Dasar antena ini dihubungkan ke sebuah penerima atau pemancar radio. Antena ini dirancang agar fleksibel sehingga tidak mudah patah. Referensi ^ Wahyu Wijaya (1 January 2003). Kamus Terminologi Angkatan Laut: Inggris-Indonesia. Gramedia Pustaka Utama. hlm. 129. ISBN 978-979-22-0372-1. 

2014 novel by Philippa Gregory The King's Curse First UK edition coverAuthorPhilippa GregoryAudio read byBianca AmatoCountryUnited KingdomLanguageEnglishSeriesThe Cousins' WarGenreHistorical fictionPublisherSimon & SchusterPublication date14 August 2014Media type Print (hardcover/paperback) Audiobook E-book Pages608ISBN978-0-85720-756-2Preceded byThe White Princess  The King's Curse is a 2014 historical novel by Philippa Gregory, part of her series The Cousins' War. …

Combre Église de Combre en 2016. Blason Administration Pays France Région Auvergne-Rhône-Alpes Département Loire Arrondissement Roanne Intercommunalité Roannais Agglomération Maire Mandat Alain Rossetti 2020-2026 Code postal 42840 Code commune 42068 Démographie Gentilé Combrisards [1] Populationmunicipale 417 hab. (2021 ) Densité 104 hab./km2 Géographie Coordonnées 46° 01′ 35″ nord, 4° 15′ 52″ est Altitude Min. 334 mMax. 482 …

Artikel ini perlu dikembangkan agar dapat memenuhi kriteria sebagai entri Wikipedia.Bantulah untuk mengembangkan artikel ini. Jika tidak dikembangkan, artikel ini akan dihapus. PemberitahuanTemplat ini mendeteksi bahwa artikel bahasa ini masih belum dinilai kualitasnya oleh ProyekWiki Bahasa dan ProyekWiki terkait dengan subjek. Perhatian: untuk penilai, halaman pembicaraan artikel ini telah diisi sehingga penilaian akan berkonflik dengan isi sebelumnya. Harap salin kode dibawah ini sebelum meni…

1814–1815 meetings to create a peace plan for Europe For other uses, see Congress of Vienna (disambiguation). Vienna peace congress redirects here. For the 2015 congress on Syria, see Vienna peace talks for Syria. This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Congress of Vienna – news · newspapers · books · schol…

1949–1989 socialist republic in Central Europe This article is about the Communist state. For the republic of 1918-1919, see First Hungarian Republic. This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Hungarian People's Republic – news · newspapers · books · scholar · JSTOR (November 2023) (Learn how and when t…

Таможенно-пограничная служба СШАсокращённо: USCBP United States Customs and Border Protectionангл. U.S. Customs and Border Protection Общая информация Страна  США[1] Юрисдикция Федеральная Дата создания 1 марта 2003 Предшественники Служба иммиграции и натурализации США и United States Customs Service[d] Руковод…

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: South Hadley High School – news · newspapers · books · scholar · JSTOR (March 2010) (Learn how and when to remove this template message) School in South Hadley, Massachusetts, United StatesSouth Hadley High SchoolSouth Hadley High School in 2012Address153 Newton S…

Munisipalitas Bohinj Občina BohinjMunisipalitasLokasi di SloveniaNegara SloveniaIbu kotaBohinjska BistricaLuas • Total333,7 km2 (1,288 sq mi)Populasi (2013) • Total5.206 • Kepadatan1,6/km2 (4,0/sq mi)Kode ISO 3166-2SI-004Situs webhttp://www.bohinj.si/ Munisipalitas Bohinj (dibaca [ˈbɔːxin]; bahasa Slovenia: Občina Bohinj) adalah sebuah munisipalitas di kawasan Karniola Hulu, barat laut Slovenia. Kursinya adalah pemuk…

TroubleAlbum studio karya EXIDDirilis03 April 2019 (2019-04-03)GenreJ-poptrip hopDurasi39:43LabelTokuma Japan CommunicationsProduserLEShinsadong TigerSingo KubotaSatoru KuriharaTaku TakahashiTak MiyazawaTsugutoshi AtoharaJustin MoretzKotaro EgamiBig BreadKronologi EXID Full Moon(2017) Trouble(2019) WE(2019) Singel dalam album Trouble Up&DownDirilis: 22 Agustus 2018 TroubleDirilis: 23 Januari 2019 Trouble adalah album studio debut Jepang (kedua secara keseluruhan) oleh girl grup Kore…

Полтавский троллейбус Описание Страна Украина Расположение Полтава Дата открытия 13 сентября 1962 Оператор КП Полтаваэлектроавтотранс Маршрутная сеть Число маршрутов 9 (c 11.04.2022) Длина сети 72,6 км Подвижной состав Число ПС 79, с них 2 служебных Основные типы ПС ЮМЗ-Т1Р, ЮМЗ-Т2, ЮМЗ…

Drs. H.Irwansyah Kasim Daeng Marala Wakil Ketua II DPRD Kabupaten MarosMasa jabatan2014 – 31 Januari 2015PendahuluH. Sudirman, S.E.PenggantiH. Muhammad Yusuf Damang, S.Sos. Informasi pribadiLahir(1955-10-01)1 Oktober 1955Wajo, Sulawesi SelatanMeninggal31 Januari 2015(2015-01-31) (umur 59)Kota Makassar, Sulawesi Selatan, IndonesiaPartai politikGolkar (1982-1992)Gerindra (2011-2015)Suami/istriInce Nurlinda SariHubunganIr. Iriantosyah Kasim DM, M.Si (adik)Ilhamsyah Kasim DM (adik)Hj…

2013 single by Jessica MauboyBeautifulSingle by Jessica Mauboyfrom the album Beautiful Released22 November 2013 (2013-11-22)RecordedRondor/Universal Recording StudioGenreDance[1]Length3:12LabelSonySongwriter(s) Jessica Mauboy Charles Hinshaw Chaz Mishan David Delazyn Producer(s)The FliptonesJessica Mauboy singles chronology Pop a Bottle (Fill Me Up) (2013) Beautiful (2013) I Am Australian (2014) Music videoBeautiful on YouTube Beautiful is a song recorded by Australian…

2012 song by Nicki Minaj Marilyn MonroeSong by Nicki Minajfrom the album Pink Friday: Roman Reloaded Recorded2011Conway StudiosBeluga Heights Studio (Los Angeles, California)GenrePopLength3:21Label Young Money Cash Money Republic Songwriter(s) Onika Maraj Daniel James Leah Haywood Ross Golan J.R. Rotem Producer(s) J.R. Rotem Dreamlab Audio videoMarilyn Monroe on YouTube Marilyn Monroe is a 2012 song by American rapper Nicki Minaj. The song was written by Minaj, Daniel James, Leah Haywood, Ross G…

2016年美國總統選舉 ← 2012 2016年11月8日 2020 → 538個選舉人團席位獲勝需270票民意調查投票率55.7%[1][2] ▲ 0.8 %   获提名人 唐納·川普 希拉莉·克林頓 政党 共和黨 民主党 家鄉州 紐約州 紐約州 竞选搭档 迈克·彭斯 蒂姆·凱恩 选举人票 304[3][4][註 1] 227[5] 胜出州/省 30 + 緬-2 20 + DC 民選得票 62,984,828[6] 65,853,514[6] 得…

Kembali kehalaman sebelumnya