Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

60%
+1 −0
Challenges Looping counter

C, 30 + 1-4 byte f(m){f(printf("%0*i\n",m,0));} Has this limitations: counter stops working at INT_MAX or at stack overflow. Needs a input value to indicate on which line we start. 0 starts...

posted 1y ago by H_H‭  ·  edited 1y ago by H_H‭

Answer
#4: Post edited by user avatar H_H‭ · 2023-09-08T15:07:09Z (about 1 year ago)
  • ## C, 30 bytes + 1-4 byte
  • f(m){f(printf("%0*i\n",m,0));}
  • Has this limitations:
  • - counter stops working at `INT_MAX` or at stack overflow.
  • - Needs a input value to indicate on which line we start. `0` starts on the line with one character.
  • - It uses `0` and not `*` as output character
  • Because of the additional input number, i added the + 1 byte in the title. If you call the program, you need to write `f(0)`, this is why the +4 bytes in the title.
  • ### Fully working program, 36 bytes:
  • main(m){main(printf("%0*i\n",m,0));}
  • ## C, 30 + 1-4 byte
  • f(m){f(printf("%0*i\n",m,0));}
  • Has this limitations:
  • - counter stops working at `INT_MAX` or at stack overflow.
  • - Needs a input value to indicate on which line we start. `0` starts on the line with one character.
  • - It uses `0` and not `*` as output character
  • Because of the additional input number, i added the + 1 in the title. If you call the program, you need to write `f(0)`, this is why the +4 in the title.
  • ### Fully working program, 36 byte:
  • main(m){main(printf("%0*i\n",m,0));}
#3: Post edited by user avatar H_H‭ · 2023-09-04T16:39:09Z (about 1 year ago)
  • ## C, 30 bytes + 1-4 byte
  • `f(m){f(printf("%0*i
  • ",m,0));}`
  • Has this limitations:
  • - counter stops working at `INT_MAX` or at stack overflow.
  • - Needs a input value to indicate on which line we start. `0` starts on the line with one character.
  • - It uses `0` and not `*` as output character
  • Because of the additional input number, i added the + 1 byte in the title. If you call the program, you need to write `f(0)`, this is why the +4 bytes in the title.
  • ### Fully working program, 36 bytes:
  • `main(m){main(printf("%0*i
  • ",m,0));}`
  • ## C, 30 bytes + 1-4 byte
  • f(m){f(printf("%0*i
  • ",m,0));}
  • Has this limitations:
  • - counter stops working at `INT_MAX` or at stack overflow.
  • - Needs a input value to indicate on which line we start. `0` starts on the line with one character.
  • - It uses `0` and not `*` as output character
  • Because of the additional input number, i added the + 1 byte in the title. If you call the program, you need to write `f(0)`, this is why the +4 bytes in the title.
  • ### Fully working program, 36 bytes:
  • main(m){main(printf("%0*i
  • ",m,0));}
#2: Post edited by user avatar H_H‭ · 2023-08-30T14:17:07Z (about 1 year ago)
  • ## C, 30 bytes + 1-4 byte
  • `f(m){f(printf("%0*i\n",m,0));}`
  • Has this limitations:
  • - counter stops working at `INT_MAX`, maybe a bit sooner.
  • - Needs a input value to indicate on which line we start. `0` starts on the line with one character.
  • - It uses `0` and not `*` as output character
  • Because of the additional input number, i added the + 1 byte in the title. If you call the program, you need to write `f(0)`, this is why the +4 bytes in the title.
  • ### Fully working program, 36 bytes:
  • `main(m){main(printf("%0*i\n",m,0));}`
  • ## C, 30 bytes + 1-4 byte
  • `f(m){f(printf("%0*i\n",m,0));}`
  • Has this limitations:
  • - counter stops working at `INT_MAX` or at stack overflow.
  • - Needs a input value to indicate on which line we start. `0` starts on the line with one character.
  • - It uses `0` and not `*` as output character
  • Because of the additional input number, i added the + 1 byte in the title. If you call the program, you need to write `f(0)`, this is why the +4 bytes in the title.
  • ### Fully working program, 36 bytes:
  • `main(m){main(printf("%0*i\n",m,0));}`
#1: Initial revision by user avatar H_H‭ · 2023-08-30T14:15:02Z (about 1 year ago)
## C, 30 bytes + 1-4 byte

`f(m){f(printf("%0*i\n",m,0));}`

Has this limitations:

- counter stops working at `INT_MAX`, maybe a bit sooner.
- Needs a input value to indicate on which line we start. `0` starts on the line with one character.
- It uses `0` and not `*` as output character

Because of the additional input number, i added the + 1 byte in the title. If you call the program, you need to write `f(0)`, this is why the +4 bytes in the title.

### Fully working program, 36 bytes: 

`main(m){main(printf("%0*i\n",m,0));}`