« first day (2140 days earlier)      last day (2694 days later) » 

9:01 AM
Halp to golf return!(k%11)&k&(l>7)&(l<10);?
 
!(k%11&&k&&l>7&&l<10) ?
uh wait
!(k%11)&k&&l>7&&l<10
that doesn't work though
because k might be even
so you'd need !(k%11)&&k&&l>7&&l<10 (still a byte shorter)
 
Oh thanks
 
Also I think you can reduce the two comparisons to l^8<2
yeah that should work
 
I knew some bit magic could be done but I wasn't sure how, thanks!
 
same byte count, more fun: l^8<2*!(k%11)*!!k
 
9:11 AM
Woah looks straight from a golfing lang
 
haha
 
@MartinEnder actually, I can remove the !! and say "returns 0 if invalid, something else if valid"
 
9:27 AM
Ummm I have a challenge idea
 
It's kinda a mix of and
 
So the first program prints the target language
So a valid program is print"Python"
For the second program, you must make another program that outputs to STDOUT the language name
But you must use at least 1/2 of the characters
(You can change characters around if you want)
And you get extra characters to place
Actually it should print a number instead, makes the challenge easier
The portion is that the cop must have a sub-optimal solution to replace chars, and an optimal solution
If the robber can golf the cop's solution, then the robber wins the difference in code length
The cops winner is the first person to have a safe submission in a week
And to make a new answer, someone must crack the old one
The cop must reveal their answer upon the code being cracked or their submission being safe
So yup that's the challenge
 
@betseg no you can't, because a non-zero value would change the 2 to something larger and therefore allow lengths other than 8 or 9.
 
9:36 AM
I know, i noticed after it's too late to remove message
 
Hang on @MartinEnder how long have you been mod "pro tempore" for Computer Graphics?
That's a long absence
 
absence?
 
abcense
 
ummm?
 
Doesn't pro tempore mean you're filling in for someone?
 
9:37 AM
I don't know what you mean, but I've been a mod since the site left private beta, which was a bit over a year ago
No it doesn't. It just means I'm a non-elected beta moderator.
 
Pro tempore (/ˌproʊ ˈtɛmpəri/, /ˌproʊ ˈtɛmpərɛ/ or /ˌproʊ ˈtɛmpəreɪ/), abbreviated pro tem or p.t., is a Latin phrase which best translates to "for the time being" in English. This phrase is often used to describe a person who acts as a locum tenens (placeholder) in the absence of a superior, such as the President pro tempore of the United States Senate, who acts in place of the President of the United States Senate, the Vice President of the United States. Legislative bodies can have one or more pro tempore for the presiding officer. These positions ostensibly go to legislators experienced in...
Oh I didn't read "often used" :p
 
Well, in a way that's what it means though.
The pro tempore moderators are in place until actual elections are held (which don't make sense when a site is first created).
 
Oh
So what d'you people think of the challenge?
 
hm, not sure whether it adds anything interesting that you don't get from a plain CnR or answer-chaining challenge.
 
10:33 AM
@Dennis Is your permanent code for Ryser's algorithm or Glynn's?
 
@Mego Well, that's kind of a depressing mix-up :')
 
hi @MartinEnder
 
Just being mixed up with someone you frequently argue with, not specifically Nathan
 
Hello
I've just gotten a ridiculous error message
>>> def coin_simulation(num_iter=100):
	prizes = []
	for I in range(num_iter):
		prize_pot = 1
		while True:
			if random.random() >= 0.5:
				prize_pot *= 2
			else:
				prizes.sppend(prize_pot)
				break
	return prizes

>>> coin_simulation()
Traceback (most recent call last):
  File "<pyshell#11>", line 1, in <module>
    coin_simulation()
  File "<pyshell#10>", line 9, in coin_simulation
    prizes.sppend(prize_pot)
AttributeError: 'list' object has no attribute 'sppend'
Sorry about the tabs. IDLE shell uses tabs instead of spaces for some reason
 
10:45 AM
Typo? Did you mean to write spend?
 
Blind bleeping nutcase I am :D
Should have actually read that
Nah, didn't see the typo cause I'm blind and prideful
Fixing now. Thanks
Well, s's also look a little like a's in that font
 
@Sherlock9 you should change your font
 
Okay. From Courier New to what do you suggest?
Ooh Lucida Console is interesting
 
On second thought, I'm not entirely sure a new font will help. I think my eyes are just tired
It's not even 6 pm though
I stand corrected. DejaVu Sans Mono, which is what Spyder uses, is a bit better
 
Just code in comic sans, what's the worst that could happen?
 
0
A: Sandbox for Proposed Challenges

SEJPMVariable-Prices income! code-golf math Introduction and credit Assume you're a bartender. You have many happy people in your bar at most times, but many only ever drink the very same drink and too few for your taste and you want to change that. So you introduce a system where the price of a ...

 
11:05 AM
>_< I know well enough to be coding in monospace fonts, for a start
Oh yeah, I've got a neat idea to Sandbox. Brb
 
Hmm, SE pages are randomly freezing for me :S
 
@Downgoat
 
11:21 AM
why are there so many goats in texas?
 
The default answer is that it's Texas
 
Halp why printf("%d",2^2<2); prints 2
 
which would mean it's 2^(2<2) <=> 2^0 <=> 2
 
that's too bad
 
11:31 AM
@MartinEnder so your code was wrong ;_;
 
sorry :|
it's still shorter to insert parentheses though
 
ik
 
0
A: Sandbox for Proposed Challenges

ZgarbVolumes of ASCII cuboids code-golf ascii-art geometry Introduction In this challenge, you are given as input the ASCII representation of the net of a rectangular cuboid. The format is this: ....+--+....... ....|##|....... ....|##|....... ....|##|....... +---+--+---+--+ |###|##|###|##| +---+...

 
HALLO
 
11:48 AM
Calm down m8
 
NO
 
12:06 PM
@Dennis isn't that piped through STDIN? if so, how does that get eval'd without any code?
 
2
Q: Interleave strings

AdámInspiration.* I cannot believe we have not had this challenge before: Task Given one or more printable ASCII strings, interleave them by taking one character from each string, cyclically until out of characters. If a string runs out of characters before the others, just skip that one from then ...

 
0
A: Sandbox for Proposed Challenges

mojimonsterPrint the missing primes number primes code-golf The Task Write a program or function that, when passed a numerical input x, prints or returns the primes beneath the square root of x1 that are not factors of x. Examples Let f(x) be the function called: >>> f(5) [2] >>> f(20) [3] >>> f(1...

 
12:26 PM
-2
Q: In Python (Any 3.x or 2.x) make a programme to take LCM of n input numbers simultaneously

Versatile Vasu Do it anyway just not idiotic , The winner would be one who : Do it(of course) Do it short Functions can be used but not just a single line code would be appreciated For Rest thought~~Yes,It is accepted

 
0
A: Sandbox for Proposed Challenges

Sherlock9Reverse the periodic and non-periodic parts of a decimal rational number (alt titles: Reverse a decimal rational number; Swap the ...) In every decimal representation of a rational number p/q, you have periodic tail and a non-periodic head. Some examples include: 1/70 = 0.0142857... = (0.0)(14...

 
-1
A: Is it legal to mortgage a property twice or more?

SausageKingNewZealandDo you mean sausage? I think it is legal to (eat) sausage twice.

4
lol?
 
Why does this have so many reopen votes? It wasn't changed since it was locked and suffers from arbitrary restrictions. Plus the answer should be deleted as it is invalid.
 
 
1 hour later…
1:54 PM
@TuxCopter Wow. That made my day.
 
Sausage is not only a way of thinking but also of doing — SausageKingNewZealand 1 hour ago
dat name too
 
2:06 PM
this question seems awfully like someone trying to get our SSH keys
hmm I wonder if Dennis will add API support for TIO eventually
 
@GabrielBenamy the public key? i don't see the problem
@GabrielBenamy downgoat is using something to integrate with tio
 
That's not what I mean, I mean "I wonder if I can encode my program + arguments + input in base64 encoding, pass it to TIO via an API call POST request, and get back the output"
 
Better scrape for now >_>
 
I figured as much
 
2:28 PM
@GabrielBenamy ..? When you hit run it POSTs to backend.tryitonline.net/run
 
I did not realize this
 
i don't know if it's using base64 for data transfer though
 
the actual method of data transfer is less important than that it can be done
 
"paste this code to add TIO to your page!"
 
<a href="http://tio.run">TIO</a>
 
2:33 PM
:/
No no no. It needs to be an inline box. Hopefully looking like something you'd see on a geocities page.
 
0
A: Sandbox for Proposed Challenges

TimmyDSum of Modulo Sums code-golf math number-theory Given an integer n > 9, for each possible insertion between digits in that integer, insert an addition + and evaluate. Then, take the original number modulo those results. Output the cumulative sum of these operations. An example with n = 47852: ...

 
@Zacharee1 brb moving to Texas
 
How can it be literally every goat if a dot is 500 goats?
That makes no damned sense.
 
@TimmyD funny sequence
 
@MartinEnder For the sum of modulo sums? Yeah, I was playing around with it some last night and half-convinced myself there was a pattern, but your plot seems to suggest it devolves into chaos pretty rapidly.
@Geobits <blink><a href="http://tio.run">TIO</a></blink>
 
2:41 PM
I just had my Humanities Exam and there was some guy named "B.F. Long" in it, so I wrote a BF program under his name: ++++++.[->+++++++++++<]>.
 
@TimmyD Much better. Not exactly what I was looking for, but much closer.
 
I just had an idea for a language construct: Consider a scoped section of code where variables are read as they existed at the start of the scope, but they can be assigned, and they are assigned at the end of the scope.
the trivial example is:
 
@TimmyD interestingly it's not entirely chaotic :)
 
 a = 1
 b = 2
 scope {
     a = b
     b = a
 }
 
var x = 2;
{
x = 3;
print(x); // prints 2?
}
print(x); // prints 3?
 
2:43 PM
2
assignment of the variables occurs at the end of the scope
 
That seems fairly counterintuitive.
 
Right, so x=3 occurs at the end of the scope
 
@Geobits <h1><blink><a href="http://tio.run">TIO</a></blink></h1>
 
Which my example shows
 
its basically saying "don't commit these changes until the end"
 
2:44 PM
@TuxCopter Not sure if the broken a link was intentional or typo'd ... Given that we're emulating GeoCities in 1999, it could have been either.
 
What happens if you assign multiple times? @NathanMerrill
 
@MartinEnder What happens when the x-axis is logarithmic?
 
the latter value
 
tio.run without http link to a page on the same domain, so I think even the worst Geocities page can't have this
 
@NathanMerrill do you have a good example other than swap assignment?
 
2:45 PM
But we're talking about Geocities, so idk
 
@TimmyD I was going for a more '96ish feel, but '99 is okay too.
 
Oh I have a good one for you. What happens if the last assignment is to itself?
var x = 2;
{
x = 3;
x = 4;
x = x;
}
print(x); // prints what?
 
I'd hope 4
 
The last assignment was technically x = 2 right? because x was 2 at that point
 
2:47 PM
@Rainbolt true
 
If it runs through assigning in order of scoped assignment, it should be 4
If it just finds the latest assignment, that's something else.
 
@Geobits the point is that x doesn't actually change until the }.
 
it definitely be 2
 
This reminds me of learning variable hoisting in JavaScript. It should never have been a thing.
 
@MartinEnder Right, but how does it know what to change to? It has to look through the scoped area in some way to see, so the value will be different depending on that.
 
2:49 PM
@Geobits I think what it does is for each variable x it introduces a temporary variable _x. on the LHS of assignments, all xs get replaced by _x and at the } there's an implicit x = _x
 
So then it would be 4, no?
 
Seems like it'd depend on what compiler optimisations you have on?
 
working on an example for you martin :)
 
I'd still like to see a useful example :P
 
The rule is that the assignment happens at the end of the scope. We need to know if the value being assigned is also determined at the end of the scope or not.
It's really up to Nathan who is god of this language
 
2:50 PM
var x = 2;
{
    var _x;
    _x = 3;
    _x = 4;
    _x = x;
    x = _x;
}
print(x)
@Geobits Rainbolt's example would compile to this ^
 
Ah, I see what you're saying. Yeah, assuming it works that way ;)
 
Well Geobits if you want to prove that you are right you have to write a compiler that does it your way.
Obviously.
I went up 300 SR in the last two days of playing Overwatch.
 
addTax {
	if payment == 0
		break
	if payment < 500
		payment *= 1.2
	if payment < 50
		payment *= 1.1
	# and so on
}
 
@Rainbolt PC or console?
 
PC
 
2:52 PM
Meh. The other way would be to run back through the scoped code again in order, making assignments (so no tmp variable). Not a very smart way to do it, but...
 
@NathanMerrill is it intentional that values below 50 get multiplied by 1.1*1.2?
 
oh, that was in reverse order
 
@Rainbolt Neat. You, DJMcWhateverHisNameIsNow, and I should get together and play. He and I were discussing it the other day.
 
@NathanMerrill Isn't that solved easier (imo) with if/else?
 
@DJMcMayhem ^^ I think that's a name change request
9
 
2:54 PM
hmm...that actually works without the scoe
 
@NathanMerrill also your reordering didn't do anything, since payment remains unchanged between the two ifs.
 
addTax {
	if payment == 0
		break
	if payment > 50
		payment *= 1.1
	if payment > 500
		payment *= 1.2
	# and so on
}
that's better
the problem was the "less than"
anyways, I agree that if/else would likely be better
 
Or you could use breaks or returns in each.
 
@TimmyD @DJMcMayhem My bnet tag is MapleSyrup#1506
 
it'd be much more useful in a loop (as you could mutate things multiple times)
 
2:57 PM
I had fun playing Minecraft with a bunch of code golfers. An FPS will be a different experience but probably still fun.
 
but even then, you could just break out of the loop
 
@Rainbolt I thought you were Texan. Is there a Texas in Canada, too? :P
 
actually, this is rather similar to python's (a,b) = (b,a). It basically delays the assignment of a and b until it evaluates them
it doesn't allow for multi-line assignment (and repeated assignment)
 
@Geobits Not Canadian, and neither are my friends Mooseman or Torontonian, whom I love playing with
 
@ETHproductions Thanks for the reply! I really like your work, I'm learning a lot of JS through your posts on codegolf. I didn't know I could wrap regex /regex/.
 
3:00 PM
@Rainbolt Sweet. Neither of us could remember our #### the other day - hah. I'm AdmBorkBork, so expect a friend request likely tomorrow.
 
@NathanMerrill Don't most assignment operators do that? As I understood it, the RHS is almost always evaluated before assignment.
 
@Geobits yep, its just that python allows for tuple unpacking
 
(and I only say "almost" because I just know there's some language out there that does it differently for no good reason)
 
meaning that you can assign to multiple variables with all of them being evaluated first
 
Yeah. That's one of the nice things about python. Now if they'd get their act together about the whole whitespace thing...
 
3:06 PM
which is actually a different solution to my above problem: payment = (payment > 500? payment * 1.1 : payment * 1.2)
which, obviously could be simplified, but you get the point
 
@ETHproductions Also, can I leave the assignment off all future functions?
 
@Dennis the TIO COW interpreter seems to misbehave on the Moo command
 
Hm, someone has gone through and downvoted three of my answers in a row and I'm not sure why..
 
3:23 PM
Crap, I missed something in the original spec of this problem...
Now I have to delete my beautiful COW algorithm
 
@MartinEnder hahaha, idk I just recovered from moylex
@Rainbolt OK, cool I'll go add you. My tag is djmcmayhem but I don't remember the freaking number
 
Since neither of you remember your number, I can bring you together after you add me :)
 
Or I could just go figure it out
 
3:42 PM
should I submit an issue to a 5-year-old github repository
 
This seems like it might make for an interesting challenge, if someone wants to take it up.
 
Hey guys, any input on my Sandbox post?
 
I like it!
good to go main I think
 
@TimmyD I've added rainbolt, my ID is DJMcMayhem#1360
 
Neat.
 
3:53 PM
wow this sucks
 
@GabrielBenamy Do you mean created 5 years ago or untouched for 5 years?
 
@trichoplax both
but I figured out what was going on (I think)
The Moo command is very finnicky and I'm positive it's complete BS
 
Check if the guy that created the repo is still active on Github
 
No reason why you shouldn't, but it sounds like you've already guessed the probability of response is low...
 
If current memory block has a 0 in it, read a single ASCII character from STDIN and store it in the current memory block. If the current memory block is not 0, then print the ASCII character that corresponds to the value in the current memory block to STDOUT.
 
3:55 PM
@GabrielBenamy BS sounds fitting for COW
 
0
Q: Make a number Fouriest

Jorge PerezThe problem is taken from this comic: http://www.smbc-comics.com/?id=2874 Your program must convert a number to the smallest base system in which it has the most fours in it's digit sequence. Shortest code wins! Function entries are allowed provided that the function prints the base in which ...

 
@GabrielBenamy If you get no response after a while, you can go ahead and fork instead.
Plus what Fatalize said...
 
@trichoplax But in doing that, I change the interpreter and so it's not valid for challenges older than my fork
 
@GabrielBenamy That applies whether you fork or the original repo gets updated
If a change is made, you'll only be able to compete in older challenges using the older version of the interpreter
 
Literally my only option at this point for the binary-to-decimal conversion is to read in a massive integer (believe me, when you can only operate via adding 1 or subtracting 1, 1000000 is massive) and manually divide it
because I think I just figured out how to use the Moo command... and it gobbles an entire line, meaning you can't read one character at a time, it just reads the first character on a line and discards the rest..................
so you have to separate your inputs on separate lines, but the problem spec says you can't separate your input
 
4:01 PM
Sounds like this challenge isn't suited to this language (or vice versa)
 
I mean yeah, but I came up with a beautiful solution using only 177 bytes, assuming I could separate the characters, posted it with an explanation chart and everything, and then had to delete it 30 seconds later because I realized it didn't fit the spec
 
If you just want the fun of solving the underlying challenge, you can ignore the input requirements and just not post it to PPCG. If you want to post to PPCG, sounds like you'll need to double check the input requirements of future challenges before starting work, to avoid disappointment
Must be pretty frustrating though...
 
I like the dichotomy of Perl vs COW
Perl is a non-esoteric language and usually wins among non-esoteric languages
COW is an esoteric language and usually has the highest byte count among esoteric languages
 
@EᴀsᴛᴇʀʟʏIʀᴋ Thanks :D I only posted it 3 hours ago, though, so I'm going to let it ferment a little longer while I go look for some very late dinner
 
Oy. It's -18C right now. (0f)
 
4:23 PM
I feel like this isn't an original idea, but I don't know the term for it. In essence, you create a "Live" variable, such as a = LiveBool(true). Then, if you were to do b = !a and a.set(false), then b would be true. You could do similar things with integers, and so forth
 
Pointer?
Not exactly, but...
More like a function that uses a pointer to a.
 
ven
it works better the "other way around".
var a = true; var b = function () { return !a; }. :P
 
@NathanMerrill what applications would that have?
 
ven
or c# properties, pretty much the same as well.
 
I really should get around to installing Java again.
 
ven
4:27 PM
O.o
put down the java, @Geobits. we can get through this together.
 
You can pry my java out of my mug-warmed, dead hands.
2
 
I'm pretty sure geobits has mastered the art of the star-bait
4
 
Did you uninstall Java, or is it just that you haven't reinstalled it after your computer problems?
 
@DJMcMayhem its basically is a auto-updating variable. Consider a large equation that takes lots of values. You could easily change one of the inputs and it would automatically update to the result
 
4:30 PM
@Geobits It runs on 3 billion devices, you know
like credit cards
 
it'd be super useful for guis, as you could simply assign things, and they would magically update
 
@trichoplax Haven't reinstalled yet. Been really lazy this week.
 
Qt does stuff similar to that, except the idea is slightly different
 
 
@NathanMerrill But isn't that essentially a function?
 
4:32 PM
Thanks to Geobits, it's down to 2,999,999,999 devices
 
@Geobits yes. Its simply the syntax that is different
 
ven
@NathanMerrill you don't need that, though
 
really? Having GUIs automatically show the state of stuff is one of the most performed task when dealing with them
 
@NathanMerrill Pytek has something similar to this
 
why do you think there are a gazillion JS frameworks that do variable binding
 
4:34 PM
variable <: expression
 
so a <: b + c; b += 1, a would be larger than 1?
 
ven
@NathanMerrill yes but observables/watchers are unrelated to "variables with inverses"
you can also say it's a proxy that delegates all its operations to two variables
 
@NathanMerrill Yes
 
@ven I wasn't intending that the only variable type was boolean
I was just using it as an example
 
Equivalent to a = \() { b + c } (a = lambda: b + c in Python)
 
4:37 PM
so, the value is lazy
 
Basically.
 
I was more thinking of something that was push, not pull
what's the opposite of lazy?
 
Ah, for expensive operations?
 
Eager
But that's just regular =
But the point is that whenever b changes a changes too
It isn't just lazy evaluation per se
 
1
Q: Please release me!

venAs code-golfers, we're not used to releasing (surely). We're gonna need a few tools to help us do that. Of course, to help marketing a new release, we need a nice and shiny Release Version. Who doesn't get excited when they hear about version 3.0.0? Task Your task will be to write a program/ro...

 
4:38 PM
So you want some sort of watcher on b that runs and updates a only once, rather than evaluating it each time a is used?
 
well, every time you access the value of a, you have to recalculate
@Geobits exactly
both would be useful
 
Do you want an almost-lazy value, that doesn't do the work immediately, but has it all done before next time you access the value?
 
Or one that does the work when it's accessed only the first time after a change?
 
it largely depends as to what operations are more common. If you are changing the underlying values a lot, then you'd want it to be a lambda. If you are accessing the final variable a lot, then you'd want it to be push-based
 
@DJMcMayhem You could say he's the ma-star?
 
4:42 PM
I don't really want to bring the debate in here, but:
No, you just disagree that it's happening. The post that kicked this off was (imo) exactly the showoffy type of thing designed to attract "cool" votes that I don't want to see, clever or not. — Geobits 8 mins ago
@Geobits did you mean that you don't want to see the cool votes, or the post itself?
I'm assuming the latter, but I wanted to clarify
 
Both, because the post is going to attract those votes, no matter how much people may discourage it.
 
sure, but fundamentally, you really aren't interested in reading such posts?
 
On a blog or something, sure. There are lots of places that would fit that sort of thing.
 
"don't want to see" here (missing word)
 
Fair enough. I thought that was implied, but I'll add it if the timer hasn't run out.
Oh, 11 mins ago :(
 
4:45 PM
@NathanMerrill Well, not access. Just modify.
You should probably let the interpreter worry about that one though :P
 
ok. I still think my argument holds. I think you prefer keeping the purity of the site, while I prefer increasing the cleverness of the site. That said, it appears that the majority of the people agree with you, so I won't pursue it :)
 
Nice challenge, @ven
 
ven
@GabrielBenamy thanks! it's my first.
 
One day I'll learn Perl6
 
ven
you should! it's amazing.
 
4:49 PM
If someone carves a granite unicorn over 15 years using only their fingernails, I'm impressed and I definitely want to see it, but I don't want to see it in a woodwork competition. There are other places.
 
also, even though I disagree with Dennis' post, I think tuskiomi's post was poorly argued (I downvoted it as well). I think its a good example why people should post what they agree with and not play the devil's advocate
 
@NathanMerrill I'd be interested to see a good counterargument posted as a full answer, whether I agree with it or not.
 
I'll second that
 
I've mostly put it all in the comments
 
It would still be good to have it all in a central place for voting and further comments
 
4:52 PM
true, I'm writing one up
 
But finally, I completed it.
Maybe later, I'll share what my first attempt was starting to look like. It was ugly.
 
bah, as I'm writing this post, I'm arguing myself out
 
@Geobits What do you mean? Use brackets?
 
@Sherlock9 lol have fun
 
is there a different way I can say "maximize/minimize your score"
 
4:58 PM
optimise?
 
oh, that's what I'm looking for
thanks
 
@NathanMerrill minmax
 
That might get confused with:
Minimax (sometimes MinMax or MM) is a decision rule used in decision theory, game theory, statistics and philosophy for minimizing the possible loss for a worst case (maximum loss) scenario. Originally formulated for two-player zero-sum game theory, covering both the cases where players take alternate moves and those where they make simultaneous moves, it has also been extended to more complex games and to general decision-making in the presence of uncertainty. == Game theory == === In general games === The maximin value of a player is the largest value that the player can be sure to get without...
 

« first day (2140 days earlier)      last day (2694 days later) »