g | x | w | all
Bytes Lang Time Link
032APLNARS250821T055115ZRosario
013Pip P211215T175147ZDLosc
053Python 3220919T203318ZPandu
011Pyth220919T220501Zhakr14
014Brachylog211221T135811ZHjulle
163SimpleTemplate 0.84211218T171754ZIsmael M
062C211216T134331ZLucas Em
027X8664 Machine Code211217T071141Zme'
007Jelly211215T174644Zcaird co
112Scratch211217T154311ZNolan
033Perl 5211217T011040ZXcali
045Clojure211216T225228Zwintermu
008Jelly211216T211420Zlynn
055Python 3211215T160336ZJoseph W
010Vyxal211216T120311Zlyxal
036Python 2211215T161523ZG B
031Desmos211216T080745ZAiden Ch
01005AB1E211215T171023ZKevin Cr
023Wolfram Language Mathematica211216T064633Zatt
046Python 3 with NumPy211216T012755ZGavin S.
012Husk211215T174114ZDominic
037Retina 0.8.2211215T210044ZNeil
016BQN211215T182955ZDLosc
035JavaScript V8211215T154724ZArnauld
038APOL211215T181835ZGinger
014Charcoal211215T174029ZNeil
012MathGolf211215T172246ZKevin Cr
017R211215T155617ZGiuseppe
022R211215T153610ZDominic
014APL Dyalog Unicode211215T161344Zovs
027Ruby211215T161002ZG B
024APL+WIN211215T155438ZGraham

APL(NARS), 32 chars

a/⍨{∧/(9+⍳8)(⍳8)∊¨⍨0 18⊤⍵}¨a←⍳!7

This 0 18⊤⍵ it seems convert omega to a cople of numbers x,y: that y=⍵ mod 18 x=floor(⍵÷18) test:

  a/⍨{∧/(9+⍳8)(⍳8)∊¨⍨0 18⊤⍵}¨a←⍳!7
181 182 183 184 185 186 187 188 199 200 201 202 203 204 205 206 217 218 219 220 221 
  222 223 224 235 236 237 238 239 240 241 242 253 254 255 256 257 258 259 260 271 
  272 273 274 275 276 277 278 289 290 291 292 293 294 295 296 307 308 309 310 311 
  312 313 314 

Pip -P, 13 bytes

181+18*_+BMC8

Try it online!

Explanation

181+18*_+BMC8
          MC   Map the following function to coordinate pairs
            8  from an 8x8 grid:
181+            181 plus
    18*_        18 times the row number
        +B      plus the column number

Here's a 15-byte solution that uses base conversion:

_FD18Mt,18CP\,8
      t,18       Range from 10 to 18 (not including 18)
          CP     Cartesian product with
            \,8  Range from 1 to 8 (including 8)
     M           To each of the resulting pairs, map:
_FD18              Convert from list of digits in base 18

Attempt This Online!

Python 3, 53 bytes

b=181
while b<308:[print(b+x)for x in range(8)];b+=18

Try it online!

I believe this straightforward solution is currently the shortest vanilla Python 3 solution. :)

Pyth, 12 11 bytes

iR18*}T17S8

Try it here!

-1 byte thanks to Steffan!

Explanation:
iR18*}T17S8 | Full code
------------+--------------------------
    *       | Cartesian product of
     }T17   |  [10..17]
         S8 |  [1..8]
iR18        | Convert each from base 18

Brachylog, 14 bytes

8⟦₁+₉ᶻ\↔ẋ~ḃ₁₈ᵐ

Try it online!

8⟦₁               Range [1..8]
   +₉ᶻ            Add 9 to each element [[1,10],[2,11],..,[8,17]]
      \↔          Transpose and swap [[10..17],[1..8]]
        ẋ         Cartesian product [[10,1],[10,2]..]
         ~ḃ₁₈ᵐ    Convert each element from base 18

SimpleTemplate 0.84, 163 bytes

This code simply outputs a space separated list of numbers.

{@setN 181}{@for to314}{@if_ matches"@18[2-8]|199|2([09][0-6]|3[5-9]|4[012]|5[3-9]|60|7[1-8]|89|9[0-6])|(21|30)[789]|(22|31)[0-4]@"}{@setN N,_}{@/}{@/}{@echoj" "N}

It looks yucky, but works!

How it works?

The code loops from 0 to 314, and then verifies if the number matches the following regular expression:

@18[2-8]|199|2([09][0-6]|3[5-9]|4[012]|5[3-9]|60|7[1-8]|89|9[0-6])|(21|30)[789]|(22|31)[0-4]@

If it matches, it is added to the array of numbers we need.

The generated array looks like this:

[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[181,182],183],184],185],186],187],188],199],200],201],202],203],204],205],206],217],218],219],220],221],222],223],224],235],236],237],238],239],240],241],242],253],254],255],256],257],258],259],260],271],272],273],274],275],276],277],278],289],290],291],292],293],294],295],296],307],308],309],310],311],312],313],314]

And this is the final output:

181 182 183 184 185 186 187 188 199 200 201 202 203 204 205 206 217 218 219 220 221 222 223 224 235 236 237 238 239 240 241 242 253 254 255 256 257 258 259 260 271 272 273 274 275 276 277 278 289 290 291 292 293 294 295 296 307 308 309 310 311 312 313 314

The {@echo} will automatically flatten the array internally, before printing it.


Ungolfed:

The code is pretty nasty to look at, so, here's an ungolfed version that does the same:

{@set numbers 181}

{@for i from 0 to 314}
    {@if i matches "@18[2-8]|199|2([09][0-6]|3[5-9]|4[012]|5[3-9]|60|7[1-8]|89|9[0-6])|(21|30)[789]|(22|31)[0-4]@"}
        {@set numbers numbers, i}
    {@/}
{@/}

{@echo separator " " numbers}

About the language

There are a few things that are important to know to fully understand how it works.

Running the code:

You can run the code on: http://sandbox.onlinephpfunctions.com/code/117ed06567a1d0e710e75b963566b86b510ca7ab

Please pick a version between 5.6 and 7.4.13. Can't fix the 8.0.0 compatibility issue without invalidating this answer.

C, 64, 62 bytes

Thank you @JustinFinnerty for the improvement

j;main(i){for(i=9;++i%18;)while(++j%9)printf("%d ",i*18+j%9);}

Try it here!

Less golfed version:

i,j;
main(){
    for(i=9;++i%18;)
        while(++j%9)
            printf("%d ",i*18+j%9);
}

X86-64 Machine Code, Microsoft Calling Convention, 27 bytes

33 C0                xor         eax,eax  
B0 B5                mov         al,0B5h  
B2 08                mov         dl,8  
outerLoop:
B6 08                mov         dh,8  
innerLoop:
89 01                mov         dword ptr [rcx],eax  
48 83 C1 04          add         rcx,4  
FF C0                inc         eax  
FE CE                dec         dh  
75 F4                jne         innerLoop  
04 0A                add         al,0Ah  
FE CA                dec         dl  
75 EC                jne         outerLoop  
C3                   ret  

Which has the following function signature:

extern "C" void chessNumbers(uint32_t* out);

Jelly, 8 7 bytes

9Ṗ+pṖḅḤ

Try it online!

-1 byte thanks to Lynn by combining our answers, so make sure to upvote their answer as well!

How it works

9Ṗ+pṖḅḤ - Main link. Takes no arguments
9       - Set the return value to 9, and execute with 9 on the left
 Ṗ      - Pop, yielding [1,2,3,4,5,6,7,8]
  +     - Add 9 to each: [10,11,12,13,14,15,16,17]
    Ṗ   - Pop, yielding [1,2,3,4,5,6,7,8]
   p    - Cartesian product: [[10,1],[10,2],...,[17,8]]
      Ḥ - Unhalve; Yield 18
     ḅ  - Unbase; Convert [a, b] to 18a+b

Scratch, 112 bytes

Try it online!

Not much room for improvement

when gf clicked
set[N v]to(170
delete all of[C v
repeat(8
change[N v]by(10
repeat(8
change[N v]by(1
add(N)to[C v

Commentated:

when gf clicked      Initiates code
set[N v]to(170       Sets N to 98 (in base-18)
delete all of[C v    Clears the list
repeat(8             Loops code for each column of the chessboard
change[N v]by(10     Increases the tens digit by 1 and decreases the ones digit by 8
repeat(8             Loops code for each row of the chessboard
change[N v]by(1      Increases the ones digit by 1
add(N)to[C v         Adds N to the list

Perl 5, 33 bytes

map{//;say$_+$'*18for 1..8}10..17

Try it online!

Clojure, 59 45 bytes

(map read-string(for[x"abcdefgh"y"12345678"](str"18r"x y)))

(for[x(range 10 18)y(range 1 9)](+(* 18 x)y))

Jelly, 8 bytes

18⁵rṖp8ḅ

Try it online!

18         18
  ⁵r       Range from ⁵=10: [10..18]
    Ṗ      Remove last element: [10..17] ([a..h])
     p8    Cartesian product with [1..8]
       ḅ   Convert from base 18

Python 3, 55 bytes

Edit: Was 56 bytes, now 55. Thanks to Dronir for proposing printing the numbers as a list.

Edit: Was 57 bytes, now 56. Thanks to Neil for proposing the -~j modification.

print([18*i-~j for i in range(10,18)for j in range(8)])

Try it online!

Python 2, 53 bytes

Thanks to Kevin Cruijssen for propsing switching to Python 2 to save a couple of bytes.

print[18*i-~j for i in range(10,18)for j in range(8)]

Try it online!

Vyxal, 11 10 bytes

8:Ẋ18vβ⁺=+

Try it Online!

I actually didn't port anything for once lol 05ab1e porting go brrr.

Explained

8:Ẋ18vβ⁺=+
8:Ẋ        # The cartesian product of the range(1, 9) and range(1, 9)
   18vβ    # convert each pair from arbitrary base 18
       ⁺=+ # add 162 to each (128 + the index of `=` in the vyxal codepage)

11 bytes

8ƛ₀*9ɾM18vβ

Try it Online!

8ƛ₀*9ɾM18vβ
8ƛ          # For each item n in the range [1, 8]:
  ₀*        #   Mulitply n by 10
    9ɾM     #   [[n * 10, x] for x in range(1, 10)]
       18vβ #   and convert each from arbitrary base 18 to base 10

Python 2, 37 36 bytes

x=64
while x:x-=1;print 314-x-x/8*10

Try it online!

1 byte saved thanks to loopy walt

Desmos, 37 31 bytes

[a+bfora=[1...8],b=[10...17]18]

Try It On Desmos!

Try It On Desmos! - Prettified

Finally got a chance to utilize the new list comprehension feature in Desmos!

Explanation:

[   for                       ]         initiate list comprehension for loop
       a=[1...8],                       loop from a=1 to a=8, incrementing by 1
                 b=[10...17]18          loop from b=10*18 to b=17*18, incrementing by 18
                                        (essentially creates a nested for loop)
 a+b                                    calculate a+b

05AB1E, 11 10 bytes

8Lã18δβƵz+

-1 byte thanks to @ovs.

Try it online.

A port of @JosephWalker's Python 3 answer is 11 bytes: 7ÝT+18*8LâO - Try it online.
A port of @Arnauld's JavaScript first answer is 12 bytes: ƵΔƵÖŸʒ<18%8‹ - Try it online.
A port of @GB's Ruby answer is 12 bytes as well: 63ÝD8÷T*ƵΘ++ - Try it online.
A port of @ovs' APL answer is 13 bytes: ƵgLD18%9›ÏƵη+ - Try it online.
A port of @Giuseppe's R answer is 14 bytes: 80ƵgŸ8÷18*8LÞ+ - Try it online.

Explanation:

8L         # Push a list in the range [1,8]
  ã        # Create all possible pairs with the cartesian product
     δ     # Map over each pair:
   18 β    #  Convert it from a base-18 list to an integer
       Ƶz+ # And add 162 to each
           # (after which the result is output implicitly)

See this 05AB1E answer of mine (section How to compress large integers?) to understand why Ƶz is 162.

Wolfram Language (Mathematica), 23 bytes

18#+162+#2&~Array~{8,8}

Try it online!

Returns a 2d array.

Python 3 with NumPy, 62 52 46 bytes

lambda:18*r_[10:18]+c_[1:9]
from numpy import*

Try it online!

Utilizing the option to return output in a 2d array. I'm a little fuzzy on how I/O is allowed in python so let me know if this is unacceptable / I need more boilerplate.

Thanks to loopy wait for r_ and c_

Husk, 12 bytes

ṠṪ+mo*18+9ḣ8

Try it online!

          ḣ8 # get the range from 1..8
Ṡ            # Ṡfgx = f(g(x),x)
             # so we use the range 1..8 twice
             # once directly as an argument to f
             # and once after applying g to it
 Ṫ+          # f = Ṫ+ = outer product by addition
   mo*18+9   # g = 
   mo        #   map over each element
        +9   #   add 9
     *18     #   and then multiply by 18

Retina 0.8.2, 37 bytes


63$*¶

$.`
.+
$*_181$*
_{8}
18$*
%`.

Try it online! Explanation:


63$*¶

$.`

Insert the numbers from 0 to 63.

.+
$*_181$*

Convert to unary and add 181.

_{8}
18$*

Add an extra 10 for each multiple of 8 in the original number.

%`.

Convert to decimal.

BQN, 16 bytes

(181+⊢+18×⊣)⌜˜↕8

Run it online! Outputs an 8x8 array of numbers.

Explanation

A port of my Pip solution.

(181+⊢+18×⊣)⌜˜↕8
               ↕8  Range(8)
(           )⌜˜    Generate a table, using that range twice, with this function:
        18×⊣         18 times left argument
     ⊢+              plus right argument
 181+                 plus 181

JavaScript (V8), 35 bytes

Test modulo \$18\$.

for(n=180;n<314;)n++%18<8&&print(n)

Try it online!


JavaScript (V8), 36 bytes

Expanding \$[0\dots63]\$ in reverse order to \$[181\dots314]\$.

for(n=64;n--;)print(314-(n>>3)*10-n)

Try it online!

APOL, 38 bytes

Port of Joeph Walker's genius answer, all credit goes to him.

ḟ(10 18 v(0 ∋) ḟ(1 9 p(*(18 +(∋ ⁰)))))

Sadly, APOL doesn't support nested for counters, so I have to use a clunkier solution. Maybe I'll implement them and come back to this later.

Charcoal, 14 bytes

I⁺¹⁸¹E⁶⁴↨¹⁸↨ι⁸

Try it online! Link is to verbose version of code. I had three 15 byte solutions (including one which generated the range a1..h8 and converted them from base 18) but I was able to golf one of them down to 14. Explanation:

      ⁶⁴        Literal integer `64`
     E          Map over implicit range
            ι   Current integer
           ↨ ⁸  Divmod by 8 using base conversion
        ↨¹⁸     Interpret as base 18
 ⁺¹⁸¹           Vectorised add 181
I               Cast to string
                Implicitly print

MathGolf, 12 bytes

8r♂+G*mÉ8╒+─

Try it online.

Explanation:

8r           # Push a list in the range [0,8)
  ♂+         # Add 10 to each to make the range [10,18)
    G*       # Multiply each by 18
      m      # Map over this list,
       É     # Using 3 characters as inner code-block:
        8╒   #  Push range [1,8]
          +  #  Add the map-integer to each
           ─ # After the map: flatten the list of lists
             # (after which the entire stack is output implicitly as result)

R, 35 17 bytes

1:8+18*80:143%/%8

Try it online!

R, 44 25 22 bytes

x=180:313;x[x%%18<8]+1

Try it online!

APL (Dyalog Unicode), 14 bytes

171+⍸9<18|⍳143

Try it online!

Ruby, 27 bytes

64.times{|x|p x+x/8*10+181}

Try it online!

APL+WIN, 24 bytes

18⊥(∊9+¨8/¨⍳8),[.1]64⍴⍳8

Try it online! Thanks to Dyalog Classic