Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Tribute to a classic

V1: Inspired by DreamWarrior's "Be happy", this straightforward submission embeds a small pixel-art image in each colour channel. I didn't even have to golf the code!
V2: now with considerably shorter code & a thick black border isolating only the "game screen".
V3: spaceship, bullet, damaged aliens and blue border, oh my! Trying to aim for this, roughly.

// RED
#define g(I,S,W,M)j/128%8==I&W>>(j/32%4*16+i/64)%M&S[abs(i/4%16-8)-(I%2&i%64<32)]>>j/4%8&1
return g(1,"_\xB6\\\x980円0円0円",255L<<36,64)?j:0;
// GREEN
#define S g(6,"\xFF\xFE\xF8\xF8\xF8\xF8\xF0\x0",1L<<22,64)|i/4==104&j/24==30
return g(2,"<\xBC\xB6}30円p0円0円",4080,32)|S?j:0;
// BLUE
return g(3,"_7\xB6\xFE\x5E34円0円",0x70000000FD0,64)|S|abs(i/4-128)==80&abs(j/4-128)<96|abs(j/4-128)==96&abs(i/4-128)<80?j:0;

Space invaders


I happened to stumble upon an edit by Umber Ferrule Umber Ferrule whose avatar inspired me to add another pixel-art-based entry. Since the core idea of the code is largely similar to the Space Invaders one, I'm appending it to this entry, though the two definitely had different challenging points. For this one, getting pink right (at the expense of white) and the fact that it's a rather big sprite proved nice challenges. The hexadecimal escapes (\xFF etc) in the red channel represent their corresponding characters in the source file (that is, the red channel in the source file contains binary data), whereas the octal escapes are literal (i.e. present in the source file).

// RED
#define g(S)(S[i/29%18*2+j/29/8%2]>>j/29%8&1)*DM1*(abs(i-512)<247&abs(j-464)<232)
return g("\xF3\xF2\xF2\x10\xF40円\xF2\x10\xE1\xE0\x810円\x800円\x800円0円0円0円0円@0円! \x03d8,=\x2C\x99\x84\xC3\x82\xE1\xE3");
// GREEN
return g(";376円z34円377円374円372円30円k360円3円200円0円0円0円0円0円0円200円0円300円0円341円 373円d307円354円303円374円e374円;376円;377円")? DM1 : BL(i,j)? DM1/2 : 0;
// BLUE
return g("363円360円362円20円364円0円362円20円341円340円200円0円200円0円200円0円0円0円0円0円0円0円0円0円0円08円0円<0円230円0円300円0円341円340円") / 2;

Bub (Bubble Bobble)

Tribute to a classic

V1: Inspired by DreamWarrior's "Be happy", this straightforward submission embeds a small pixel-art image in each colour channel. I didn't even have to golf the code!
V2: now with considerably shorter code & a thick black border isolating only the "game screen".
V3: spaceship, bullet, damaged aliens and blue border, oh my! Trying to aim for this, roughly.

// RED
#define g(I,S,W,M)j/128%8==I&W>>(j/32%4*16+i/64)%M&S[abs(i/4%16-8)-(I%2&i%64<32)]>>j/4%8&1
return g(1,"_\xB6\\\x980円0円0円",255L<<36,64)?j:0;
// GREEN
#define S g(6,"\xFF\xFE\xF8\xF8\xF8\xF8\xF0\x0",1L<<22,64)|i/4==104&j/24==30
return g(2,"<\xBC\xB6}30円p0円0円",4080,32)|S?j:0;
// BLUE
return g(3,"_7\xB6\xFE\x5E34円0円",0x70000000FD0,64)|S|abs(i/4-128)==80&abs(j/4-128)<96|abs(j/4-128)==96&abs(i/4-128)<80?j:0;

Space invaders


I happened to stumble upon an edit by Umber Ferrule whose avatar inspired me to add another pixel-art-based entry. Since the core idea of the code is largely similar to the Space Invaders one, I'm appending it to this entry, though the two definitely had different challenging points. For this one, getting pink right (at the expense of white) and the fact that it's a rather big sprite proved nice challenges. The hexadecimal escapes (\xFF etc) in the red channel represent their corresponding characters in the source file (that is, the red channel in the source file contains binary data), whereas the octal escapes are literal (i.e. present in the source file).

// RED
#define g(S)(S[i/29%18*2+j/29/8%2]>>j/29%8&1)*DM1*(abs(i-512)<247&abs(j-464)<232)
return g("\xF3\xF2\xF2\x10\xF40円\xF2\x10\xE1\xE0\x810円\x800円\x800円0円0円0円0円@0円! \x03d8,=\x2C\x99\x84\xC3\x82\xE1\xE3");
// GREEN
return g(";376円z34円377円374円372円30円k360円3円200円0円0円0円0円0円0円200円0円300円0円341円 373円d307円354円303円374円e374円;376円;377円")? DM1 : BL(i,j)? DM1/2 : 0;
// BLUE
return g("363円360円362円20円364円0円362円20円341円340円200円0円200円0円200円0円0円0円0円0円0円0円0円0円0円08円0円<0円230円0円300円0円341円340円") / 2;

Bub (Bubble Bobble)

Tribute to a classic

V1: Inspired by DreamWarrior's "Be happy", this straightforward submission embeds a small pixel-art image in each colour channel. I didn't even have to golf the code!
V2: now with considerably shorter code & a thick black border isolating only the "game screen".
V3: spaceship, bullet, damaged aliens and blue border, oh my! Trying to aim for this, roughly.

// RED
#define g(I,S,W,M)j/128%8==I&W>>(j/32%4*16+i/64)%M&S[abs(i/4%16-8)-(I%2&i%64<32)]>>j/4%8&1
return g(1,"_\xB6\\\x980円0円0円",255L<<36,64)?j:0;
// GREEN
#define S g(6,"\xFF\xFE\xF8\xF8\xF8\xF8\xF0\x0",1L<<22,64)|i/4==104&j/24==30
return g(2,"<\xBC\xB6}30円p0円0円",4080,32)|S?j:0;
// BLUE
return g(3,"_7\xB6\xFE\x5E34円0円",0x70000000FD0,64)|S|abs(i/4-128)==80&abs(j/4-128)<96|abs(j/4-128)==96&abs(i/4-128)<80?j:0;

Space invaders


I happened to stumble upon an edit by Umber Ferrule whose avatar inspired me to add another pixel-art-based entry. Since the core idea of the code is largely similar to the Space Invaders one, I'm appending it to this entry, though the two definitely had different challenging points. For this one, getting pink right (at the expense of white) and the fact that it's a rather big sprite proved nice challenges. The hexadecimal escapes (\xFF etc) in the red channel represent their corresponding characters in the source file (that is, the red channel in the source file contains binary data), whereas the octal escapes are literal (i.e. present in the source file).

// RED
#define g(S)(S[i/29%18*2+j/29/8%2]>>j/29%8&1)*DM1*(abs(i-512)<247&abs(j-464)<232)
return g("\xF3\xF2\xF2\x10\xF40円\xF2\x10\xE1\xE0\x810円\x800円\x800円0円0円0円0円@0円! \x03d8,=\x2C\x99\x84\xC3\x82\xE1\xE3");
// GREEN
return g(";376円z34円377円374円372円30円k360円3円200円0円0円0円0円0円0円200円0円300円0円341円 373円d307円354円303円374円e374円;376円;377円")? DM1 : BL(i,j)? DM1/2 : 0;
// BLUE
return g("363円360円362円20円364円0円362円20円341円340円200円0円200円0円200円0円0円0円0円0円0円0円0円0円0円08円0円<0円230円0円300円0円341円340円") / 2;

Bub (Bubble Bobble)

Add Bub
Source Link
FireFly
  • 7.3k
  • 30
  • 41

Tribute to a classic

V1: Inspired by DreamWarrior's "Be happy", this straightforward submission embeds a small pixel-art image in each colour channel. I didn't even have to golf the code!
V2: now with considerably shorter code & a thick black border isolating only the "game screen".
V3: spaceship, bullet, damaged aliens and blue border, oh my! Trying to aim for this, roughly.

// RED
#define g(I,S,W,M)j/128%8==I&W>>(j/32%4*16+i/64)%M&S[abs(i/4%16-8)-(I%2&i%64<32)]>>j/4%8&1
return g(1,"_\xB6\\\x980円0円0円",255L<<36,64)?j:0;
// GREEN
#define S g(6,"\xFF\xFE\xF8\xF8\xF8\xF8\xF0\x0",1L<<22,64)|i/4==104&j/24==30
return g(2,"<\xBC\xB6}30円p0円0円",4080,32)|S?j:0;
// BLUE
return g(3,"_7\xB6\xFE\x5E34円0円",0x70000000FD0,64)|S|abs(i/4-128)==80&abs(j/4-128)<96|abs(j/4-128)==96&abs(i/4-128)<80?j:0;

Space invaders


I happened to stumble upon an edit by Umber Ferrule whose avatar inspired me to add another pixel-art-based entry. Since the core idea of the code is largely similar to the Space Invaders one, I'm appending it to this entry, though the two definitely had different challenging points. For this one, getting pink right (at the expense of white) and the fact that it's a rather big sprite proved nice challenges. The hexadecimal escapes (\xFF etc) in the red channel represent their corresponding characters in the source file (that is, the red channel in the source file contains binary data), whereas the octal escapes are literal (i.e. present in the source file).

// RED
#define g(S)(S[i/29%18*2+j/29/8%2]>>j/29%8&1)*DM1*(abs(i-512)<247&abs(j-464)<232)
return g("\xF3\xF2\xF2\x10\xF40円\xF2\x10\xE1\xE0\x810円\x800円\x800円0円0円0円0円@0円! \x03d8,=\x2C\x99\x84\xC3\x82\xE1\xE3");
// GREEN
return fmax(g(";376円z34円377円374円372円30円k360円3円200円0円0円0円0円0円0円200円0円300円0円341円 373円d307円354円303円374円e374円;376円;377円"),? DM1 : BL(i,j)? DM1/2); : 0;
// BLUE
return g("363円360円362円20円364円0円362円20円341円340円200円0円200円0円200円0円0円0円0円0円0円0円0円0円0円08円0円<0円230円0円300円0円341円340円") / 2;

Bub (Bubble Bobble)Bub (Bubble Bobble)

Tribute to a classic

V1: Inspired by DreamWarrior's "Be happy", this straightforward submission embeds a small pixel-art image in each colour channel. I didn't even have to golf the code!
V2: now with considerably shorter code & a thick black border isolating only the "game screen".
V3: spaceship, bullet, damaged aliens and blue border, oh my! Trying to aim for this, roughly.

// RED
#define g(I,S,W,M)j/128%8==I&W>>(j/32%4*16+i/64)%M&S[abs(i/4%16-8)-(I%2&i%64<32)]>>j/4%8&1
return g(1,"_\xB6\\\x980円0円0円",255L<<36,64)?j:0;
// GREEN
#define S g(6,"\xFF\xFE\xF8\xF8\xF8\xF8\xF0\x0",1L<<22,64)|i/4==104&j/24==30
return g(2,"<\xBC\xB6}30円p0円0円",4080,32)|S?j:0;
// BLUE
return g(3,"_7\xB6\xFE\x5E34円0円",0x70000000FD0,64)|S|abs(i/4-128)==80&abs(j/4-128)<96|abs(j/4-128)==96&abs(i/4-128)<80?j:0;

Space invaders


I happened to stumble upon an edit by Umber Ferrule whose avatar inspired me to add another pixel-art-based entry. Since the core idea of the code is largely similar to the Space Invaders one, I'm appending it to this entry, though the two definitely had different challenging points. For this one, getting pink right (at the expense of white) and the fact that it's a rather big sprite proved nice challenges. The hexadecimal escapes (\xFF etc) in the red channel represent their corresponding characters in the source file (that is, the red channel in the source file contains binary data), whereas the octal escapes are literal (i.e. present in the source file).

// RED
#define g(S)(S[i/29%18*2+j/29/8%2]>>j/29%8&1)*DM1*(abs(i-512)<247&abs(j-464)<232)
return g("\xF3\xF2\xF2\x10\xF40円\xF2\x10\xE1\xE0\x810円\x800円\x800円0円0円0円0円@0円! \x03d8,=\x2C\x99\x84\xC3\x82\xE1\xE3");
// GREEN
return fmax(g(";376円z34円377円374円372円30円k360円3円200円0円0円0円0円0円0円200円0円300円0円341円 373円d307円354円303円374円e374円;376円;377円"), BL(i,j)/2);
// BLUE
return g("363円360円362円20円364円0円362円20円341円340円200円0円200円0円200円0円0円0円0円0円0円0円0円0円0円08円0円<0円230円0円300円0円341円340円") / 2;

Bub (Bubble Bobble)

Tribute to a classic

V1: Inspired by DreamWarrior's "Be happy", this straightforward submission embeds a small pixel-art image in each colour channel. I didn't even have to golf the code!
V2: now with considerably shorter code & a thick black border isolating only the "game screen".
V3: spaceship, bullet, damaged aliens and blue border, oh my! Trying to aim for this, roughly.

// RED
#define g(I,S,W,M)j/128%8==I&W>>(j/32%4*16+i/64)%M&S[abs(i/4%16-8)-(I%2&i%64<32)]>>j/4%8&1
return g(1,"_\xB6\\\x980円0円0円",255L<<36,64)?j:0;
// GREEN
#define S g(6,"\xFF\xFE\xF8\xF8\xF8\xF8\xF0\x0",1L<<22,64)|i/4==104&j/24==30
return g(2,"<\xBC\xB6}30円p0円0円",4080,32)|S?j:0;
// BLUE
return g(3,"_7\xB6\xFE\x5E34円0円",0x70000000FD0,64)|S|abs(i/4-128)==80&abs(j/4-128)<96|abs(j/4-128)==96&abs(i/4-128)<80?j:0;

Space invaders


I happened to stumble upon an edit by Umber Ferrule whose avatar inspired me to add another pixel-art-based entry. Since the core idea of the code is largely similar to the Space Invaders one, I'm appending it to this entry, though the two definitely had different challenging points. For this one, getting pink right (at the expense of white) and the fact that it's a rather big sprite proved nice challenges. The hexadecimal escapes (\xFF etc) in the red channel represent their corresponding characters in the source file (that is, the red channel in the source file contains binary data), whereas the octal escapes are literal (i.e. present in the source file).

// RED
#define g(S)(S[i/29%18*2+j/29/8%2]>>j/29%8&1)*DM1*(abs(i-512)<247&abs(j-464)<232)
return g("\xF3\xF2\xF2\x10\xF40円\xF2\x10\xE1\xE0\x810円\x800円\x800円0円0円0円0円@0円! \x03d8,=\x2C\x99\x84\xC3\x82\xE1\xE3");
// GREEN
return g(";376円z34円377円374円372円30円k360円3円200円0円0円0円0円0円0円200円0円300円0円341円 373円d307円354円303円374円e374円;376円;377円")? DM1 : BL(i,j)? DM1/2 : 0;
// BLUE
return g("363円360円362円20円364円0円362円20円341円340円200円0円200円0円200円0円0円0円0円0円0円0円0円0円0円08円0円<0円230円0円300円0円341円340円") / 2;

Bub (Bubble Bobble)

Add Bub
Source Link
FireFly
  • 7.3k
  • 30
  • 41

Tribute to a classic

V1: Inspired by DreamWarrior's "Be happy", this straightforward submission embeds a small pixel-art image in each colour channel. I didn't even have to golf the code!
V2: now with considerably shorter code & a thick black border isolating only the "game screen".
V3: spaceship, bullet, damaged aliens and blue border, oh my! Trying to aim for this, roughly.

// RED
#define g(I,S,W,M)j/128%8==I&W>>(j/32%4*16+i/64)%M&S[abs(i/4%16-8)-(I%2&i%64<32)]>>j/4%8&1
return g(1,"_\xB6\\\x980円0円0円",255L<<36,64)?j:0;
// GREEN
#define S g(6,"\xFF\xFE\xF8\xF8\xF8\xF8\xF0\x0",1L<<22,64)|i/4==104&j/24==30
return g(2,"<\xBC\xB6}30円p0円0円",4080,32)|S?j:0;
// BLUE
return g(3,"_7\xB6\xFE\x5E34円0円",0x70000000FD0,64)|S|abs(i/4-128)==80&abs(j/4-128)<96|abs(j/4-128)==96&abs(i/4-128)<80?j:0;

Space invaders


I happened to stumble upon an edit by Umber Ferrule whose avatar inspired me to add another pixel-art-based entry. Since the core idea of the code is largely similar to the Space Invaders one, I'm appending it to this entry, though the two definitely had different challenging points. For this one, getting pink right (at the expense of white) and the fact that it's a rather big sprite proved nice challenges. The hexadecimal escapes (\xFF etc) in the red channel represent their corresponding characters in the source file (that is, the red channel in the source file contains binary data), whereas the octal escapes are literal (i.e. present in the source file).

// RED
#define g(S)(S[i/29%18*2+j/29/8%2]>>j/29%8&1)*DM1*(abs(i-512)<247&abs(j-464)<232)
return g("\xF3\xF2\xF2\x10\xF40円\xF2\x10\xE1\xE0\x810円\x800円\x800円0円0円0円0円@0円! \x03d8,=\x2C\x99\x84\xC3\x82\xE1\xE3");
// GREEN
return fmax(g(";376円z34円377円374円372円30円k360円3円200円0円0円0円0円0円0円200円0円300円0円341円 373円d307円354円303円374円e374円;376円;377円"), BL(i,j)/2);
// BLUE
return g("363円360円362円20円364円0円362円20円341円340円200円0円200円0円200円0円0円0円0円0円0円0円0円0円0円08円0円<0円230円0円300円0円341円340円") / 2;

Bub (Bubble Bobble)

Tribute to a classic

V1: Inspired by DreamWarrior's "Be happy", this straightforward submission embeds a small pixel-art image in each colour channel. I didn't even have to golf the code!
V2: now with considerably shorter code & a thick black border isolating only the "game screen".
V3: spaceship, bullet, damaged aliens and blue border, oh my! Trying to aim for this, roughly.

// RED
#define g(I,S,W,M)j/128%8==I&W>>(j/32%4*16+i/64)%M&S[abs(i/4%16-8)-(I%2&i%64<32)]>>j/4%8&1
return g(1,"_\xB6\\\x980円0円0円",255L<<36,64)?j:0;
// GREEN
#define S g(6,"\xFF\xFE\xF8\xF8\xF8\xF8\xF0\x0",1L<<22,64)|i/4==104&j/24==30
return g(2,"<\xBC\xB6}30円p0円0円",4080,32)|S?j:0;
// BLUE
return g(3,"_7\xB6\xFE\x5E34円0円",0x70000000FD0,64)|S|abs(i/4-128)==80&abs(j/4-128)<96|abs(j/4-128)==96&abs(i/4-128)<80?j:0;

Space invaders

Tribute to a classic

V1: Inspired by DreamWarrior's "Be happy", this straightforward submission embeds a small pixel-art image in each colour channel. I didn't even have to golf the code!
V2: now with considerably shorter code & a thick black border isolating only the "game screen".
V3: spaceship, bullet, damaged aliens and blue border, oh my! Trying to aim for this, roughly.

// RED
#define g(I,S,W,M)j/128%8==I&W>>(j/32%4*16+i/64)%M&S[abs(i/4%16-8)-(I%2&i%64<32)]>>j/4%8&1
return g(1,"_\xB6\\\x980円0円0円",255L<<36,64)?j:0;
// GREEN
#define S g(6,"\xFF\xFE\xF8\xF8\xF8\xF8\xF0\x0",1L<<22,64)|i/4==104&j/24==30
return g(2,"<\xBC\xB6}30円p0円0円",4080,32)|S?j:0;
// BLUE
return g(3,"_7\xB6\xFE\x5E34円0円",0x70000000FD0,64)|S|abs(i/4-128)==80&abs(j/4-128)<96|abs(j/4-128)==96&abs(i/4-128)<80?j:0;

Space invaders


I happened to stumble upon an edit by Umber Ferrule whose avatar inspired me to add another pixel-art-based entry. Since the core idea of the code is largely similar to the Space Invaders one, I'm appending it to this entry, though the two definitely had different challenging points. For this one, getting pink right (at the expense of white) and the fact that it's a rather big sprite proved nice challenges. The hexadecimal escapes (\xFF etc) in the red channel represent their corresponding characters in the source file (that is, the red channel in the source file contains binary data), whereas the octal escapes are literal (i.e. present in the source file).

// RED
#define g(S)(S[i/29%18*2+j/29/8%2]>>j/29%8&1)*DM1*(abs(i-512)<247&abs(j-464)<232)
return g("\xF3\xF2\xF2\x10\xF40円\xF2\x10\xE1\xE0\x810円\x800円\x800円0円0円0円0円@0円! \x03d8,=\x2C\x99\x84\xC3\x82\xE1\xE3");
// GREEN
return fmax(g(";376円z34円377円374円372円30円k360円3円200円0円0円0円0円0円0円200円0円300円0円341円 373円d307円354円303円374円e374円;376円;377円"), BL(i,j)/2);
// BLUE
return g("363円360円362円20円364円0円362円20円341円340円200円0円200円0円200円0円0円0円0円0円0円0円0円0円0円08円0円<0円230円0円300円0円341円340円") / 2;

Bub (Bubble Bobble)

Make better use of free space, fix up code
Source Link
FireFly
  • 7.3k
  • 30
  • 41
Loading
Golfed & with "border"
Source Link
FireFly
  • 7.3k
  • 30
  • 41
Loading
Source Link
FireFly
  • 7.3k
  • 30
  • 41
Loading

AltStyle によって変換されたページ (->オリジナル) /