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

#Processing, (削除) 204 (削除ここまで)(削除) 200 (削除ここまで)(削除) 198 (削除ここまで) 197 bytes

Processing, (削除) 204 (削除ここまで)(削除) 200 (削除ここまで)(削除) 198 (削除ここまで) 197 bytes

5 bytes saved thanks to @L. Serné by using smarter ternaries

void draw(){int i;String s=((i=hour())>9?i:" "+i)+" ";for(i=0;i<minute();i++)s+="-";s+="\n"+((i=hour()+1)>9?i>23?" 0":i:" "+i)+" ";for(i=0;i<60-minute();i++)s+="-";print(s);for(;i++<99;)println();}

This outputs 30+ newlines for each update (which takes place when the frame gets updated)

###Ungolfed

Ungolfed

void draw(){
 int i;
 String s=((i=hour())>9?i:" "+i)+" ";
 for(i=0;i<minute();i++)
 s+="-";
 s+="\n"+((i=hour()+1)>9?i>23?" 0":i:" "+i)+" ";
 for(i=0;i<60-minute();i++)
 s+="-";print(s);
 for(;i++<99;)
 println();
}

#Processing, (削除) 204 (削除ここまで)(削除) 200 (削除ここまで)(削除) 198 (削除ここまで) 197 bytes

5 bytes saved thanks to @L. Serné by using smarter ternaries

void draw(){int i;String s=((i=hour())>9?i:" "+i)+" ";for(i=0;i<minute();i++)s+="-";s+="\n"+((i=hour()+1)>9?i>23?" 0":i:" "+i)+" ";for(i=0;i<60-minute();i++)s+="-";print(s);for(;i++<99;)println();}

This outputs 30+ newlines for each update (which takes place when the frame gets updated)

###Ungolfed

void draw(){
 int i;
 String s=((i=hour())>9?i:" "+i)+" ";
 for(i=0;i<minute();i++)
 s+="-";
 s+="\n"+((i=hour()+1)>9?i>23?" 0":i:" "+i)+" ";
 for(i=0;i<60-minute();i++)
 s+="-";print(s);
 for(;i++<99;)
 println();
}

Processing, (削除) 204 (削除ここまで)(削除) 200 (削除ここまで)(削除) 198 (削除ここまで) 197 bytes

5 bytes saved thanks to @L. Serné by using smarter ternaries

void draw(){int i;String s=((i=hour())>9?i:" "+i)+" ";for(i=0;i<minute();i++)s+="-";s+="\n"+((i=hour()+1)>9?i>23?" 0":i:" "+i)+" ";for(i=0;i<60-minute();i++)s+="-";print(s);for(;i++<99;)println();}

This outputs 30+ newlines for each update (which takes place when the frame gets updated)

Ungolfed

void draw(){
 int i;
 String s=((i=hour())>9?i:" "+i)+" ";
 for(i=0;i<minute();i++)
 s+="-";
 s+="\n"+((i=hour()+1)>9?i>23?" 0":i:" "+i)+" ";
 for(i=0;i<60-minute();i++)
 s+="-";print(s);
 for(;i++<99;)
 println();
}
added 10 characters in body
Source Link
user41805
  • 13.4k
  • 6
  • 43
  • 88

#Processing, (削除) 204 (削除ここまで) (削除) 200 (削除ここまで) 198(削除) 198 (削除ここまで) 197 bytes

45 bytes saved thanks to @L. Serné by using smarter ternaries

void draw(){int i;String s=((i=hour())>9?i:" "+i)+" ";for(i=0;i<minute();i++)s+="-";s+="\n"+(((i=hour()+1)>24?i=0:i)>9?i>23?" 0":i:" "+i)+" ";for(i=0;i<60-minute();i++)s+="-";print(s);for(;i++<99;)println();}

This outputs 30+ newlines for each update (which takes place when the frame gets updated)

Golfing in progress...###Ungolfed

void draw(){
 int i;
 String s=((i=hour())>9?i:" "+i)+" ";
 for(i=0;i<minute();i++)
 s+="-";
 s+="\n"+((i=hour()+1)>9?i>23?" 0":i:" "+i)+" ";
 for(i=0;i<60-minute();i++)
 s+="-";print(s);
 for(;i++<99;)
 println();
}

#Processing, (削除) 204 (削除ここまで) (削除) 200 (削除ここまで) 198 bytes

4 bytes saved thanks to @L. Serné by using smarter ternaries

void draw(){int i;String s=((i=hour())>9?i:" "+i)+" ";for(i=0;i<minute();i++)s+="-";s+="\n"+(((i=hour()+1)>24?i=0:i)>9?i:" "+i)+" ";for(i=0;i<60-minute();i++)s+="-";print(s);for(;i++<99;)println();}

This outputs 30+ newlines for each update (which takes place when the frame gets updated)

Golfing in progress...

#Processing, (削除) 204 (削除ここまで) (削除) 200 (削除ここまで) (削除) 198 (削除ここまで) 197 bytes

5 bytes saved thanks to @L. Serné by using smarter ternaries

void draw(){int i;String s=((i=hour())>9?i:" "+i)+" ";for(i=0;i<minute();i++)s+="-";s+="\n"+((i=hour()+1)>9?i>23?" 0":i:" "+i)+" ";for(i=0;i<60-minute();i++)s+="-";print(s);for(;i++<99;)println();}

This outputs 30+ newlines for each update (which takes place when the frame gets updated)

###Ungolfed

void draw(){
 int i;
 String s=((i=hour())>9?i:" "+i)+" ";
 for(i=0;i<minute();i++)
 s+="-";
 s+="\n"+((i=hour()+1)>9?i>23?" 0":i:" "+i)+" ";
 for(i=0;i<60-minute();i++)
 s+="-";print(s);
 for(;i++<99;)
 println();
}
added 9 characters in body
Source Link
user41805
  • 13.4k
  • 6
  • 43
  • 88

#Processing, (削除) 202204 (削除ここまで) 200(削除) 200 (削除ここまで) 198 bytes

4 bytes saved thanks to @L. Serné by using smarter ternaries

void draw(){int i=0;Stringi;String s=((i=hour())>9?i:" "+i)+" ";for(i=0;i<minute();i++)s+="-";s+="\n"+(((i=hour()+1)>24?i=0:i)>9?i:" "+i)+" ";for(i=0;i<60-minute();i++)s+="-";print(s);for(;i++<99;)println();}

This outputs 30+ newlines for each update (which takes place when the frame gets updated)

Golfing in progress...

#Processing, (削除) 202 (削除ここまで) 200 bytes

4 bytes saved thanks to @L. Serné by using smarter ternaries

void draw(){int i=0;String s=((i=hour())>9?i:" "+i)+" ";for(i=0;i<minute();i++)s+="-";s+="\n"+(((i=hour()+1)>24?i=0:i)>9?i:" "+i)+" ";for(i=0;i<60-minute();i++)s+="-";print(s);for(;i++<99;)println();}

This outputs 30+ newlines for each update (which takes place when the frame gets updated)

Golfing in progress...

#Processing, (削除) 204 (削除ここまで) (削除) 200 (削除ここまで) 198 bytes

4 bytes saved thanks to @L. Serné by using smarter ternaries

void draw(){int i;String s=((i=hour())>9?i:" "+i)+" ";for(i=0;i<minute();i++)s+="-";s+="\n"+(((i=hour()+1)>24?i=0:i)>9?i:" "+i)+" ";for(i=0;i<60-minute();i++)s+="-";print(s);for(;i++<99;)println();}

This outputs 30+ newlines for each update (which takes place when the frame gets updated)

Golfing in progress...

added 75 characters in body
Source Link
user41805
  • 13.4k
  • 6
  • 43
  • 88
Loading
deleted 188 characters in body
Source Link
user41805
  • 13.4k
  • 6
  • 43
  • 88
Loading
Source Link
user41805
  • 13.4k
  • 6
  • 43
  • 88
Loading

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