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

Commonmark migration
Source Link

#Factor, (削除) 120 (削除ここまで) 113 bytes

Factor, (削除) 120 (削除ここまで) 113 bytes

I've spent class golfing this and I can't get it shorter.

Translation of: Julia.

[ [a,b] dup append 2 <combinations> [ members ] keep [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f ]

Example runs on the first 5 test cases (a value of 1000 causes it to freeze the editor, and I can't be bothered to compile an executable right now):

! with floating point division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f 
 ]
 map
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
! with rational division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap / 
 ]
 map
 
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
{ 1 3/4 11/16 63/100 6087/10000 }

#Factor, (削除) 120 (削除ここまで) 113 bytes

I've spent class golfing this and I can't get it shorter.

Translation of: Julia.

[ [a,b] dup append 2 <combinations> [ members ] keep [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f ]

Example runs on the first 5 test cases (a value of 1000 causes it to freeze the editor, and I can't be bothered to compile an executable right now):

! with floating point division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f 
 ]
 map
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
! with rational division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap / 
 ]
 map
 
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
{ 1 3/4 11/16 63/100 6087/10000 }

Factor, (削除) 120 (削除ここまで) 113 bytes

I've spent class golfing this and I can't get it shorter.

Translation of: Julia.

[ [a,b] dup append 2 <combinations> [ members ] keep [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f ]

Example runs on the first 5 test cases (a value of 1000 causes it to freeze the editor, and I can't be bothered to compile an executable right now):

! with floating point division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f 
 ]
 map
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
! with rational division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap / 
 ]
 map
 
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
{ 1 3/4 11/16 63/100 6087/10000 }
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

#Factor, (削除) 120 (削除ここまで) 113 bytes

I've spent class golfing this and I can't get it shorter.

Translation of: Julia Julia.

[ [a,b] dup append 2 <combinations> [ members ] keep [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f ]

Example runs on the first 5 test cases (a value of 1000 causes it to freeze the editor, and I can't be bothered to compile an executable right now):

! with floating point division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f 
 ]
 map
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
! with rational division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap / 
 ]
 map
 
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
{ 1 3/4 11/16 63/100 6087/10000 }

#Factor, (削除) 120 (削除ここまで) 113 bytes

I've spent class golfing this and I can't get it shorter.

Translation of: Julia.

[ [a,b] dup append 2 <combinations> [ members ] keep [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f ]

Example runs on the first 5 test cases (a value of 1000 causes it to freeze the editor, and I can't be bothered to compile an executable right now):

! with floating point division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f 
 ]
 map
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
! with rational division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap / 
 ]
 map
 
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
{ 1 3/4 11/16 63/100 6087/10000 }

#Factor, (削除) 120 (削除ここまで) 113 bytes

I've spent class golfing this and I can't get it shorter.

Translation of: Julia.

[ [a,b] dup append 2 <combinations> [ members ] keep [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f ]

Example runs on the first 5 test cases (a value of 1000 causes it to freeze the editor, and I can't be bothered to compile an executable right now):

! with floating point division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f 
 ]
 map
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
! with rational division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap / 
 ]
 map
 
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
{ 1 3/4 11/16 63/100 6087/10000 }
added 11 characters in body
Source Link
cat
  • 6.1k
  • 2
  • 27
  • 45

#Factor,(削除) 120 (削除ここまで) 113 bytes

I've spent class golfing this and I can't get it shorter.

Translation of: Julia.

[ [a,b] dup append 2 <combinations> [ members ] keep [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f ]

Example runs on the first 5 test cases (a value of 1000 causes it to freeze the editor, and I can't be bothered to compile an executable right now):

! with floating point division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f 
 ]
 map
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
! with rational division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap / 
 ]
 map
 
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
{ 1 3/4 11/16 63/100 6087/10000 }

#Factor, 113 bytes

I've spent class golfing this and I can't get it shorter.

Translation of: Julia.

[ [a,b] dup append 2 <combinations> [ members ] keep [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f ]

Example runs on the first 5 test cases (a value of 1000 causes it to freeze the editor, and I can't be bothered to compile an executable right now):

! with floating point division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f 
 ]
 map
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
! with rational division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap / 
 ]
 map
 
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
{ 1 3/4 11/16 63/100 6087/10000 }

#Factor,(削除) 120 (削除ここまで) 113 bytes

I've spent class golfing this and I can't get it shorter.

Translation of: Julia.

[ [a,b] dup append 2 <combinations> [ members ] keep [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f ]

Example runs on the first 5 test cases (a value of 1000 causes it to freeze the editor, and I can't be bothered to compile an executable right now):

! with floating point division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap /f 
 ]
 map
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
! with rational division
IN: scratchpad auto-use {
 1 
 2 
 4 
 10 
 100 
 }
 [ 
 [1,b] dup append 2 <combinations> [ members ] keep 
 [ first2 coprime? ] filter [ length ] bi@ 2 /i 1 + swap / 
 ]
 map
 
--- Data stack:
{ 1.0 0.75 0.6875 0.63 0.6087 }
{ 1 3/4 11/16 63/100 6087/10000 }
added 975 characters in body
Source Link
cat
  • 6.1k
  • 2
  • 27
  • 45
Loading
Source Link
cat
  • 6.1k
  • 2
  • 27
  • 45
Loading

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