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

added 99 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47

C (gcc), (削除) 116 (削除ここまで) (削除) 113110 (削除ここまで) 110106 bytes

Saved 3 bytes thanks to the man himself Arnauld !!!
Saved 4 bytes thanks to ceilingcat!!!

d;g;p;r;f(char*s){for(p=r=1;*s;++sp=r=1;*s;r*=pow(p,17088/ *s++%75%14|1){)for(g=0;!g;)for(g=d=p++;d>1;)g=g&&p%d--;r*=pow(p,17088/ *s%75%14|1);}d=r;;d=r;}

Try it online! Try it online!

Commented Code (before some golfs)

C (gcc), (削除) 116 (削除ここまで) (削除) 113 (削除ここまで) 110 bytes

Saved 3 bytes thanks to the man himself Arnauld!!!

d;g;p;r;f(char*s){for(p=r=1;*s;++s){for(g=0;!g;)for(g=d=p++;d>1;)g=g&&p%d--;r*=pow(p,17088/ *s%75%14|1);}d=r;}

Try it online!

Commented Code

C (gcc), (削除) 116 (削除ここまで) (削除) 110 (削除ここまで) 106 bytes

Saved 3 bytes thanks to the man himself Arnauld !!!
Saved 4 bytes thanks to ceilingcat!!!

d;g;p;r;f(char*s){for(p=r=1;*s;r*=pow(p,17088/ *s++%75%14|1))for(g=0;!g;)for(g=d=p++;d>1;)g=g&&p%d--;d=r;}

Try it online!

Commented Code (before some golfs)

added 11 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47

C (gcc), (削除) 116 (削除ここまで)(削除) 113 (削除ここまで) 113110 bytes

Saved 3 bytes thanks to the man himself Arnauld !!!

d;g;p;r;f(char*s){for(p=r=1;*s;++s){for(g=0;!g;)for(g=d=p++;d>1;)g=g&&p%d--;r*=pow(p,1816017088/ *s%80%30%14|1*s%75%14|1);}d=r;}

Try it online! Try it online!

Uses the Magic ASCII to Gödel value mapping formula from Arnauld's JavaScript answer.

d;g;p;r;f(char*s){ // declare variables and function 
 r=1 // init return value r to 1 
 p= // init prime number p to 1 
 for( ;*s;++s){ // loop over chars in s 
 for(g=0;!g;) // loop until we find the next prime 
 p++ // start by bumping p 
 d= // init divisor d to p-1 
 g= // set g to non-zero p-1 as well 
 for( ;d>1;) // loop over d until its 2
 g=g&&p%d--; // g with only remain non-zero if 
 // p is the next prime number 
 r*=pow(p, ); );// multiply r by p to the power of
 1816017088/ *s%80%30%14|1*s%75%14|1  // the Gödel value for the ASCII 
 // code, need the space so it's not 
 } // interpreted as start of comment 
 d=r; // return r
} //

C (gcc), (削除) 116 (削除ここまで) 113 bytes

d;g;p;r;f(char*s){for(p=r=1;*s;++s){for(g=0;!g;)for(g=d=p++;d>1;)g=g&&p%d--;r*=pow(p,18160/ *s%80%30%14|1);}d=r;}

Try it online!

Uses the ASCII to Gödel value mapping formula from Arnauld's JavaScript answer.

d;g;p;r;f(char*s){ // declare variables and function 
 r=1 // init return value r to 1 
 p= // init prime number p to 1 
 for( ;*s;++s){ // loop over chars in s 
 for(g=0;!g;) // loop until we find the next prime 
 p++ // start by bumping p 
 d= // init divisor d to p-1 
 g= // set g to non-zero p-1 as well 
 for( ;d>1;) // loop over d until its 2
 g=g&&p%d--; // g with only remain non-zero if 
 // p is the next prime number 
 r*=pow(p, );// multiply r by p to the power of
 18160/ *s%80%30%14|1 // the Gödel value for the ASCII 
 // code, need the space so it's not 
 } // interpreted as start of comment 
 d=r; // return r
} //

C (gcc), (削除) 116 (削除ここまで)(削除) 113 (削除ここまで) 110 bytes

Saved 3 bytes thanks to the man himself Arnauld !!!

d;g;p;r;f(char*s){for(p=r=1;*s;++s){for(g=0;!g;)for(g=d=p++;d>1;)g=g&&p%d--;r*=pow(p,17088/ *s%75%14|1);}d=r;}

Try it online!

Uses the Magic ASCII to Gödel value mapping formula from Arnauld's JavaScript answer.

d;g;p;r;f(char*s){ // declare variables and function 
 r=1 // init return value r to 1 
 p= // init prime number p to 1 
 for( ;*s;++s){ // loop over chars in s 
 for(g=0;!g;) // loop until we find the next prime 
 p++ // start by bumping p 
 d= // init divisor d to p-1 
 g= // set g to non-zero p-1 as well 
 for( ;d>1;) // loop over d until its 2
 g=g&&p%d--; // g with only remain non-zero if 
 // p is the next prime number 
 r*=pow(p, ); // multiply r by p to the power of
 17088/ *s%75%14|1  // the Gödel value for the ASCII 
 // code, need the space so it's not 
 } // interpreted as start of comment 
 d=r; // return r
} //
added 1108 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
d;g;p;r;f(char*s){ // declare variables and function 
 r=1 // init return value r to 1 
 p= // init prime number p to 1 
 for( ;*s;++s){ // loop over chars in s 
 for(g=0;!g;) // loop until we find the next prime 
 p++ // start by bumping p 
 d= // init divisor d to p-1 
 g= // set g to non-zero p-1 as well 
 for( ;d>1;) // loop over d until its 2
 g=g&&p%d--; // g with only remain non-zero if 
 // p is the next prime number 
 r*=pow(p, );// multiply r by p to the power of
 18160/ *s%80%30%14|1 // the Gödel value for the ASCII 
 // code, need the space so it's not 
 } // interpreted as start of comment 
 }  // code 
 d=r; // return r
} //
d;g;p;r;f(char*s){ // declare variables and function 
 r=1 // init return value r to 1 
 p= // init prime number p to 1 
 for( ;*s;++s){ // loop over chars in s 
 for(g=0;!g;) // loop until we find the next prime 
 p++ // start by bumping p 
 d= // init divisor d to p-1 
 g= // set g to non-zero p-1 as well 
 for( ;d>1;) // loop over d until its 2
 g=g&&p%d--; // g with only remain non-zero if 
 // p is the next prime number 
 r*=pow(p, );// multiply r by p to the power of
 18160/ *s%80%30%14|1 // the Gödel value for the ASCII 
 // need the space so it's not 
 // interpreted as start of comment 
 }  // code 
 d=r; // return r
} //
d;g;p;r;f(char*s){ // declare variables and function 
 r=1 // init return value r to 1 
 p= // init prime number p to 1 
 for( ;*s;++s){ // loop over chars in s 
 for(g=0;!g;) // loop until we find the next prime 
 p++ // start by bumping p 
 d= // init divisor d to p-1 
 g= // set g to non-zero p-1 as well 
 for( ;d>1;) // loop over d until its 2
 g=g&&p%d--; // g with only remain non-zero if 
 // p is the next prime number 
 r*=pow(p, );// multiply r by p to the power of
 18160/ *s%80%30%14|1 // the Gödel value for the ASCII 
 // code, need the space so it's not 
 } // interpreted as start of comment 
 d=r; // return r
} //
added 1108 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
Loading
added 1108 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
Loading
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
Loading

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