The Ctrl + V Game

plasturion

temporary hermit
Member
Joined
Aug 17, 2012
Messages
1,216
Trophies
2
Location
Tree
XP
3,508
Country
Poland
C:
#include <stdio.h>
#include <time.h>
int main(){
    double i,j;
    double wyn, need = 1.8848013598436708, now = 1.0,x=0,y=0;
    clock_t startT = clock();
    printf("looking for:%.16f\n",need);
    for(i=1;i<1000000;i++){
        for(j=(int)(i*0.54);j>=1;j--){
            //printf("%f / %f = %f, diff:%f\n",i,j,i/j,need - i/j);
            if( need - i/j < now && need - i/j >=0.0000000000000000){
                now = need - i/j;
                x = i;
                y = j;
            }
            if( need - i/j < 0)
                break;
        }
        //printf("\n");
    }
    printf("Closest founding: %d / %d = %.16f\n",(int)x,(int)y,x/y);
    printf("Execution time: %ds\n",((int)((float)(clock()-startT)/CLOCKS_PER_SEC)));
    return 0;
}
Code:
output:
looking for:1.8848013598436708
Closest founding: 685261 / 363572 = 1.8848013598406919
Execution time: 104s
 

K0rbo

Active Member
Newcomer
Joined
Jan 17, 2022
Messages
42
Trophies
0
Age
16
XP
193
Country
United States
Code:
org.tildearrow.furnace - Pattern Data (190)
0
F-204......|
...........|
F-405..ED03|
...........|
...........|
C-304......|
...........|
F-405..ED03|
...........|
...........|
 

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,884
Trophies
2
XP
29,325
Country
United Kingdom
1705318972085.png

Didn't know it put my screenshot on the clipboard, TIL 🤷
 
  • Wow
Reactions: impeeza

Site & Scene News

Popular threads in this forum

eof

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: Thats how high it can get