Skip to main content
Saved 24 bytes between Deadcode's suggestion and changing to a full program
Source Link
ATaco
  • 11.7k
  • 30
  • 82

BrainChild, 8181 57 bytes

function(intinclude*;int i)->int{ifj=int i=getint(i<2)return 0int j=1while;while(++j--j&&i%j)<i if!0print(i%jj==1)return 0return 1} 

Saved 24 bytes thanks to @Deadcode

Readable

functioninclude isPrime(io.bc; int i) -> int{  if= getint(i<2) return 0;  int j = 1;i;  while ((++j)<i) --j if&& (!(i%j)) return 0 return 1 {} print(j==1) 

Try It Online!Try It Online!

BrainChild, 81 bytes

function(int i)->int{if(i<2)return 0int j=1while(++j)<i if!(i%j)return 0return 1} 

Readable

function isPrime(int i) -> int{  if (i<2) return 0  int j = 1;  while ((++j)<i)  if (!(i%j)) return 0 return 1 } 

Try It Online!

BrainChild, 81 57 bytes

include*;int j=int i=getint();while(--j&&i%j)0print(j==1) 

Saved 24 bytes thanks to @Deadcode

Readable

include io.bc; int i = getint(); int j = i; while(--j && i%j){} print(j==1) 

Try It Online!

Source Link
ATaco
  • 11.7k
  • 30
  • 82

BrainChild, 81 bytes

function(int i)->int{if(i<2)return 0int j=1while(++j)<i if!(i%j)return 0return 1} 

Readable

function isPrime(int i) -> int{ if (i<2) return 0 int j = 1; while ((++j)<i) if (!(i%j)) return 0 return 1 } 

Try It Online!