Race Around the Track

JavaScript (ES6), 371 bytes

Rotates clockwise. Probably still golfable.

f=(i=24,A=[])=>i--?A.map(r=>r.join``,g=(s,x,y)=>[...s].map(c=>(j=c.charCodeAt(),d='12221',m=k=>(x-=~-d[j&7],y-=~-d[j-2&7],k--)&&((A[y]=A[y]||Array(18).fill` `)[x]='|/_\\'[j&3],k&&m(k)))(j/8&7)),g('voF`ir@kBdm',5,1),g('fWF`Qb@SBdU',6,4),g(['NFPJAT','MDWFI@S','VFHRAL','UDOFQ@K'][i/3&3],'0x'+'111123678ABCEEECBA876321'[i],'0x'+'678BCDDDDEDC876654222567'[i])).join`
`+f(i):A

Try it online!

Animated version

f=(i=24,A=[])=>i--?A.map(r=>r.join``,g=(s,x,y)=>[...s].map(c=>(j=c.charCodeAt(),d='12221',m=k=>(x-=~-d[j&7],y-=~-d[j-2&7],k--)&&((A[y]=A[y]||Array(18).fill` `)[x]='|/_\\'[j&3],k&&m(k)))(j/8&7)),g('voF`ir@kBdm',5,1),g('fWF`Qb@SBdU',6,4),g(['NFPJAT','MDWFI@S','VFHRAL','UDOFQ@K'][i/3&3],'0x'+'111123678ABCEEECBA876321'[i],'0x'+'678BCDDDDEDC876654222567'[i])).join`
`+f(i):A

F = 0;
setInterval(_ => O.textContent = f().substr((F++ % 24) * 285 + 1, 285), 200)
<pre id=O style="font-size:9px"></pre>

Less golfed

// i = frame counter, A[] = drawing matrix
f = (i = 24, A = []) =>
  i-- ?
    A.map(r =>
      r.join``,
      // g() draws the shape described by s, starting at (x, y)
      g = (s, x, y) =>
        [...s].map(c => (
          // j holds the direction in bits 0-2 and the length in bits 3-5
          // a length of 0 means 'move without drawing'
          j = c.charCodeAt(),
          d = '12221',
          // m() either draws a line or just moves the pen by 1 step
          m = k => (
            x -= ~-d[j & 7],
            y -= ~-d[j - 2 & 7],
            k--
          ) && (
            (A[y] = A[y] || Array(18).fill` `)[x] = '|/_\\'[j & 3],
            k && m(k)
          )
        )(j / 8 & 7)),
      // draw the outer boundary of the track
      g('voF`ir@kBdm', 5, 1),
      // draw the inner boundary of the track
      g('fWF`Qb@SBdU', 6, 4),
      // draw the car, using the correct shape for this frame and hard-coded coordinates
      g(['NFPJAT', 'MDWFI@S', 'VFHRAL', 'UDOFQ@K'][i / 3 & 3],
        '0x'+'111123678ABCEEECBA876321'[i],
        '0x'+'678BCDDDDEDC876654222567'[i]
      )
    ).join`\n` + f(i)
  :
    A

Canvas, 131 bytes

{↔]
ø5/22╋___71╋__84╋|¶|17╋|¶|57╋2/65╋╬
3[⁵ __¶|__|²6+2╋]
3[⁵ _¶| |¶|_|25²+╋]
3[⁵ /\¶/ /¶\/6²-2²+╋]
⁷⁸⇵{↕]∔⁶{↕]∔⁸{↕↔]∔⁷⇵⁴∔⁸⇵⁴∔⁶⁴∔⁸∔

Try it here!


Python 2, 641 639 592 576 bytes

for i in range(24):
 t='s  ______s  Xs / 642  \s Xs/875310  \sX   /:;8____   \   X  /<9:/s\   \  X />=</s  \   \ X|A@?|ss|   |X|BCB|ss|   |X|DED|ss|   |X|FHG|ss|   |X \ILK\s  /   / X  \KJM\____/   /  X   \MNPRTVs/   Xs\POQSUW  /sXs \______/s '.replace('s',4*' ')
 for c,C in[zip([chr(x)for x in range(48,88)],' '*ord(s)+r+' '*40)for s,r in zip("\0\n	!",'|____|?| ____|?\/\/?/\/\ ?\  / //\ ?_| ||_?_ | |_?_| ||_?\/\/\ ?\/\/?/  \ /\ ?| ____|?| ____|'.split('?'))][abs(12-i)]+zip('\/!','!\/')*(i>12):t=t.replace(c,C)
 print'\n'.join(l[::2*(i<13)-1]for l in t.split('X'))

Try it online!

  • -2 bytes, thanks to Kevin Cruijssen
  • -30 bytes, thanks to Mnemonic
  • -16 bytes, thanks to Jonathan