Timeline for Print random integers until 0
Current License: CC BY-SA 4.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 29, 2021 at 12:53 | comment | added | anotherOne |
@noodle9 I am going to fix this and it's nice to know I don't need to add srand . Anyway I wrote my answer even before the challenge was published, looking at the sandbox. But since I got also a recursive one, I am going to delete the iterative so there are no copies around :)
|
|
Jan 29, 2021 at 10:59 | comment | added | Noodle9 |
@dingledooper That's a very nice one (basically a do while template for golfing) - thanks! :D
|
|
Jan 29, 2021 at 10:59 | history | edited | Noodle9 | CC BY-SA 4.0 |
added 117 characters in body
|
Jan 29, 2021 at 10:48 | comment | added | dingledooper | I think this works for 42 bytes. | |
Jan 29, 2021 at 10:24 | comment | added | Noodle9 |
@Davide Turns out we don't need to call srand anymore, that rule has changed. But you still need to init i as your copy of my answer doesn't do! T_T
|
|
Jan 29, 2021 at 10:19 | history | edited | Noodle9 | CC BY-SA 4.0 |
deleted 4 characters in body
|
Jan 29, 2021 at 9:43 | history | rollback | Noodle9 |
Rollback to Revision 4
|
|
Jan 29, 2021 at 9:41 | history | edited | Noodle9 | CC BY-SA 4.0 |
added 89 characters in body
|
Jan 28, 2021 at 20:45 | comment | added | anotherOne | Ahaha I am sorry, my brain needs some rest. | |
Jan 28, 2021 at 20:28 | comment | added | Noodle9 |
@Davide Incrementing i before checking if its \$0\$ never stops! T_T
|
|
Jan 28, 2021 at 20:27 | history | edited | Noodle9 | CC BY-SA 4.0 |
added 105 characters in body
|
Jan 28, 2021 at 19:15 | comment | added | anotherOne |
Oh you are right. Then 57 bytes One byte from the i as a parameter and another byte by swapping i=! with ++
|
|
Jan 28, 2021 at 18:35 | comment | added | Noodle9 |
@Davide Yup, there's another rule about random number generation in functions can't be the same for all first and subsequent runs. Also unsure about your golf, i could be \$0\$ at the onset. But having it as a parameter saves a byte - thanks! :D
|
|
Jan 28, 2021 at 18:06 | comment | added | anotherOne | 55 bytes But is srand() necessary? | |
Jan 28, 2021 at 16:41 | history | edited | Noodle9 | CC BY-SA 4.0 |
added 77 characters in body
|
Jan 28, 2021 at 15:27 | history | edited | Noodle9 | CC BY-SA 4.0 |
edited body
|
Jan 28, 2021 at 14:56 | history | answered | Noodle9 | CC BY-SA 4.0 |