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

#Java - 162 (削除) 174 (削除ここまで)

Java - 162 (削除) 174 (削除ここまで)

It's not every day I get to use a do/while loop when golfing in Java :D

This just iterates and fills in blanks as they come. It just keeps going until there are no more _ in the result.

char[]a(int n,char[]s){char[]o=new char[n];if(n>0)do for(int i=0,j=0;i<n;i++)if(o[i]==95|o[i]<1)o[i]=s[j++%s.length];while(new String(o).contains("_"));return o;}

With line breaks:

char[]a(int n,char[]s){
 char[]o=new char[n];
 if(n>0)
 do
 for(int i=0,j=0;i<n;i++)
 if(o[i]==95|o[i]<1)
 o[i]=s[j++%s.length];
 while(new String(o).contains("_"));
 return o;
}

#Java - 162 (削除) 174 (削除ここまで)

It's not every day I get to use a do/while loop when golfing in Java :D

This just iterates and fills in blanks as they come. It just keeps going until there are no more _ in the result.

char[]a(int n,char[]s){char[]o=new char[n];if(n>0)do for(int i=0,j=0;i<n;i++)if(o[i]==95|o[i]<1)o[i]=s[j++%s.length];while(new String(o).contains("_"));return o;}

With line breaks:

char[]a(int n,char[]s){
 char[]o=new char[n];
 if(n>0)
 do
 for(int i=0,j=0;i<n;i++)
 if(o[i]==95|o[i]<1)
 o[i]=s[j++%s.length];
 while(new String(o).contains("_"));
 return o;
}

Java - 162 (削除) 174 (削除ここまで)

It's not every day I get to use a do/while loop when golfing in Java :D

This just iterates and fills in blanks as they come. It just keeps going until there are no more _ in the result.

char[]a(int n,char[]s){char[]o=new char[n];if(n>0)do for(int i=0,j=0;i<n;i++)if(o[i]==95|o[i]<1)o[i]=s[j++%s.length];while(new String(o).contains("_"));return o;}

With line breaks:

char[]a(int n,char[]s){
 char[]o=new char[n];
 if(n>0)
 do
 for(int i=0,j=0;i<n;i++)
 if(o[i]==95|o[i]<1)
 o[i]=s[j++%s.length];
 while(new String(o).contains("_"));
 return o;
}
-1
Source Link
Geobits
  • 19.7k
  • 4
  • 56
  • 125

#Java - 163162 (削除) 174 (削除ここまで)

It's not every day I get to use a do/while loop when golfing in Java :D

This just iterates and fills in blanks as they come. It just keeps going until there are no more _ in the result.

char[]a(int n,char[]s){char[]o=new char[n];if(n>0)do for(int i=0,j=0;i<n;i++)if(o[i]==95|o[i]<1)o[i]=s[j++%s.length];while(new String(o).indexOfcontains(95"_")>=0);return o;}

With line breaks:

char[]a(int n,char[]s){
 char[]o=new char[n];
 if(n>0)
 do
 for(int i=0,j=0;i<n;i++)
 if(o[i]==95|o[i]<1)
 o[i]=s[j++%s.length];
 while(new String(o).indexOfcontains(95"_")>=0);
 return o;
}

#Java - 163 (削除) 174 (削除ここまで)

It's not every day I get to use a do/while loop when golfing in Java :D

This just iterates and fills in blanks as they come. It just keeps going until there are no more _ in the result.

char[]a(int n,char[]s){char[]o=new char[n];if(n>0)do for(int i=0,j=0;i<n;i++)if(o[i]==95|o[i]<1)o[i]=s[j++%s.length];while(new String(o).indexOf(95)>=0);return o;}

With line breaks:

char[]a(int n,char[]s){
 char[]o=new char[n];
 if(n>0)
 do
 for(int i=0,j=0;i<n;i++)
 if(o[i]==95|o[i]<1)
 o[i]=s[j++%s.length];
 while(new String(o).indexOf(95)>=0);
 return o;
}

#Java - 162 (削除) 174 (削除ここまで)

It's not every day I get to use a do/while loop when golfing in Java :D

This just iterates and fills in blanks as they come. It just keeps going until there are no more _ in the result.

char[]a(int n,char[]s){char[]o=new char[n];if(n>0)do for(int i=0,j=0;i<n;i++)if(o[i]==95|o[i]<1)o[i]=s[j++%s.length];while(new String(o).contains("_"));return o;}

With line breaks:

char[]a(int n,char[]s){
 char[]o=new char[n];
 if(n>0)
 do
 for(int i=0,j=0;i<n;i++)
 if(o[i]==95|o[i]<1)
 o[i]=s[j++%s.length];
 while(new String(o).contains("_"));
 return o;
}
added 4 characters in body
Source Link
Geobits
  • 19.7k
  • 4
  • 56
  • 125

#Java - 163 (削除) 174 (削除ここまで)

It's not every day I get to use a do/while loop when golfing in Java :D

This just iterates and fills in blanks as they come. It just keeps going until there are no more _ in the result.

char[]a(int n,char[]s){char[]o=new char[n];if(n>0)do for(int i=0,j=0;i<n;i++)if(o[i]==95|o[i]<1)o[i]=s[j++%s.length];while(new String(o).indexOf(95)>=0);return o;}

With line breaks:

char[]a(int n,char[]s){
 char[]o=new char[n];
 if(n>0)
 do
 for(int i=0,j=0;i<n;i++)
 if(o[i]==95|o[i]<1)
 o[i]=s[j++%s.length];
 while(new String(o).indexOf(95)>=0);
 return o;
}

#Java - 163 (削除) 174 (削除ここまで)

It's not every day I get to use a do/while loop when golfing in Java :D This just iterates and fills in blanks as they come. It just keeps going until there are no more _ in the result.

char[]a(int n,char[]s){char[]o=new char[n];if(n>0)do for(int i=0,j=0;i<n;i++)if(o[i]==95|o[i]<1)o[i]=s[j++%s.length];while(new String(o).indexOf(95)>=0);return o;}

With line breaks:

char[]a(int n,char[]s){
 char[]o=new char[n];
 if(n>0)
 do
 for(int i=0,j=0;i<n;i++)
 if(o[i]==95|o[i]<1)
 o[i]=s[j++%s.length];
 while(new String(o).indexOf(95)>=0);
 return o;
}

#Java - 163 (削除) 174 (削除ここまで)

It's not every day I get to use a do/while loop when golfing in Java :D

This just iterates and fills in blanks as they come. It just keeps going until there are no more _ in the result.

char[]a(int n,char[]s){char[]o=new char[n];if(n>0)do for(int i=0,j=0;i<n;i++)if(o[i]==95|o[i]<1)o[i]=s[j++%s.length];while(new String(o).indexOf(95)>=0);return o;}

With line breaks:

char[]a(int n,char[]s){
 char[]o=new char[n];
 if(n>0)
 do
 for(int i=0,j=0;i<n;i++)
 if(o[i]==95|o[i]<1)
 o[i]=s[j++%s.length];
 while(new String(o).indexOf(95)>=0);
 return o;
}
-4
Source Link
Geobits
  • 19.7k
  • 4
  • 56
  • 125
Loading
-4
Source Link
Geobits
  • 19.7k
  • 4
  • 56
  • 125
Loading
3 chars
Source Link
Geobits
  • 19.7k
  • 4
  • 56
  • 125
Loading
Source Link
Geobits
  • 19.7k
  • 4
  • 56
  • 125
Loading

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