Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Timeline for Loading... Forever

Current License: CC BY-SA 3.0

28 events
when toggle format what by license comment
Apr 13, 2017 at 12:39 history edited Community Bot
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Dec 10, 2016 at 19:47 history edited Artyer CC BY-SA 3.0
added 167 characters in body
Dec 8, 2016 at 18:05 comment added Kade print'\rLoading... '+ -> print'\rLoading...', should save a byte.
Nov 28, 2016 at 16:37 comment added Artyer Also, the challenge says to print it in the correct order and you can't sleep at the beginning, so the time.time solution would most likely break that.
Nov 28, 2016 at 13:23 comment added Adalynn What lets you even assume that it will be within 10%?
Nov 28, 2016 at 8:25 comment added Tim @ZacharyT +/-10% is allowed
Nov 28, 2016 at 1:50 comment added Adalynn I know that! What lets you assume every iteration of the while loop will take a fixed duration of time?
Nov 28, 2016 at 1:34 comment added artificialnull @ZacharyT multiplying the floating point time provided by time.time() by 4 and converting to an integer gets the current time counted in quarter second increments.
Nov 28, 2016 at 0:59 comment added Adalynn What allows you to assume that the time is a multiple of 0.25?
Nov 28, 2016 at 0:57 comment added artificialnull @ZacharyT I don't think so. If you run the code I proposed, it constantly updates the line and only changes when the time is a multiple of 0.25 (achieved by multiplying by 4 and then mod 4-ing). Please correct me if I'm mistaken.
Nov 28, 2016 at 0:52 comment added Adalynn @artificialnull, that would assume that each step in the while loop takes a certain amount of time. AKA, that won't work on all systems.
Nov 28, 2016 at 0:41 comment added artificialnull I think you can save some bytes by using the time as your index instead of a counter (while 1:print'\rLoading... '+'\|/-'[int(time.time()*4)%4],) and not sleeping
Nov 27, 2016 at 22:29 history edited Artyer CC BY-SA 3.0
added 166 characters in body
Nov 27, 2016 at 22:16 history edited Artyer CC BY-SA 3.0
added 310 characters in body
Nov 27, 2016 at 22:11 comment added FlipTack I'd allow @ZacharyT 's suggestion as technically Python integers can be infinitely large, as long as the computer has memory to hold them
Nov 27, 2016 at 22:07 comment added Artyer @Neil To be totally honest, I just put the Python file in Administrator and ran it from there because the other account names are real names (Personal PC).
Nov 27, 2016 at 22:06 comment added Neil I should downvote you for logging in as Administrator...
Nov 27, 2016 at 22:05 comment added Artyer @ZacharyT That seems against the spirit of the challenge.
Nov 27, 2016 at 22:04 history edited Artyer CC BY-SA 3.0
added 2 characters in body
Nov 27, 2016 at 22:03 comment added Adalynn Won't replacing [i],;i=-~i%4 with [i%4],;i+=1 save a byte since it doesn't exceed the max for Python, only the maximum memory?
Nov 27, 2016 at 22:02 history edited Artyer CC BY-SA 3.0
Added gif
Nov 27, 2016 at 21:53 history edited Artyer CC BY-SA 3.0
Forgot `i`.
Nov 27, 2016 at 21:53 history edited FlipTack CC BY-SA 3.0
added 1 character in body
Nov 27, 2016 at 21:52 comment added Adalynn And you forgot the i in -~i.
Nov 27, 2016 at 21:51 history edited Artyer CC BY-SA 3.0
added 152 characters in body
Nov 27, 2016 at 21:51 comment added Adalynn I think that should overwrite using the carriage return.
Nov 27, 2016 at 21:48 comment added FlipTack If I remember correctly, you can use i=-~i%4 to save the bytes for the parens :)
Nov 27, 2016 at 21:46 history answered Artyer CC BY-SA 3.0
toggle format

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