« first day (1752 days earlier)      last day (3081 days later) » 

6:06 PM
@Stefnotch with caution
Chat mini challenge: a, b and n are unsigned 32-bit integers. Compute (a-b)%n (where % is proper non-negative modulo). You may use signed types but you must not use types with a width greater than 32 bits.
 
Yeah! That's right! It is pretty good for debugging though...
(Testing the hello world program....instruction for instruction.)
 
@Stefnotch there's also -d for less verbose debugging
 
:D Oh!
Hmmm...isn't that challenge pretty much impossible in Javascript?
 
yes, it's meant to be more of a conceptual challenge (relevant to languages that have the corresponding integer types)
 
@MartinBüttner would using Uint32array count?
 
6:12 PM
I don't know, I'm really not looking for an implementation, but an algorithm.
 
@MartinBüttner Oh. Nevermind ^_^
 
Does any language even have this combination of types and operators?
 
C does when I write the modulo myself.
 
@quartata ;)
 
So does brainfuck.
 
6:14 PM
Labyrinth (Assuming that a, b and n are on the top of the stack in that order)
}%{-
:P (Not part of the program)
 
@MartinBüttner I think it's impossible to write as solution to this because there's no valid language.
 
@feersum Okay, ... "[...] Compute mod(a-b,n) where mod is proper non-negative modulo [...]"
 
When Meta votes disturb you momentarily. D:
 
@feersum I'm not sure why the language needs to have a built-in % with the right semantics to have this problem make sense.
 
@MartinBüttner What should you do for weak typed languages?
 
6:17 PM
@MartinBüttner I see, you're right.
@quartata Kill them with fire.
 
@quartata "I'm really not looking for an implementation, but an algorithm."
 
@feersum D:
 
(So, my Labyrinth implementation isn't what you wanted to see....)
 
(So, my Rotor implementation won't be what you want to see....)
 
LOL!
 
6:19 PM
2.1.0.-%
 
@Stefnotch Apart from that, you've taken b modulo n, not the difference.
 
Takes input like dis [a,b,n]
 
(a>b?a-b:b-a+n)%n should be OK.
I didn't post it before since I thought it must be a puzzle with a more clever answer :P
 
@feersum Java! :D
 
a-b could overflow a 32-bit signed int.
 
6:20 PM
I feel that Pascal can do this natively ...
 
Rotor is very very weak and meek when it comes to types
If you want arbitrary order:
2.1.0.-a%
 
It works with two's complement arithmetic.
 
(a%n-b%n)%n
(If this wins, blame the power of Google!)
 
@feersum even if n is a not a power of 2?
 
@MartinBüttner Signed and unsigned addition(subtraction) are identical in two's complement arithmetic.
 
6:22 PM
@Stefnotch has the same problem if n > 2^31
 
So b-a works fine as a "negative" number even with uint32.
 
@feersum but that doesn't mean that an overflow doesn't break the modulo result, does it?
 
oops, I should have added another % in there.
 
@MartinBüttner What would happen? (If n > 2^31)
 
@feersum both -2^31 and 2^31-1 are 1 modulo 3.
@Stefnotch you get an overflow after the subtraction, which breaks the modulo
 
6:25 PM
stupid question: uhm, why?
 
@Stefnotch Because he's assuming a,b,n are ints.
 
hello all!
 
The issue with the challenge is that it assumes the language is strong-typed. A lot of languages will switch to a long with this
 
@Stefnotch when you decrement -2^31 you get an overflow which gives you 2^31-1. Normally, decrementing should reduce your modulo 3 result by 1 (or turn 0 into 2). But due to the overflow, this one decrement does not change the modulo result, which makes the final result off by 1 (per overflow, although only one overflow can happen here).
 
Yeah that first one was horribly wrong, ugh. a>=b?(a-b)%n:n-(b-a)%n should be better.
 
6:26 PM
@quartata My point is that (in such a language) I don't want to switch to a 64-bit type because of a single bit of overflow.
 
While + RegExp = awesome
 
@MartinBüttner In such a language you usually don't have a choice though
 
0
A: Parenthifiable Binary Numbers

Cᴏɴᴏʀ O'BʀɪᴇɴJavaScript ES5, 118 bytes Interesting technique in my opinion. function p(x){x=x.toString(2)[R="replace"](/1/g,"(")[R](/0/g,")");r=/\(\)/;while(x.search(r)>=0){x=x[R](r,"")}return !x} JavaScript ES6, 108 bytes (Just a "fun" golf of the above.) x=>{x=x.toString(2)[R="replace"](/1/g,"(")[R](/...

 
a%n<b%n?a%n+n-b%n:a%n-b%n
 
@quartata you do, see feersum's solution
 
6:27 PM
You can't check for a overflow because calculating such a thing would cause an overflow which would be "caught"
 
where is @Mego
 
@feersum that looks good
how about (a+b)%n? :)
 
@VoteToClose lmao
 
@VoteToClose are we doing this again?
 
6:28 PM
;-; school tablet blocks imgur/tumblr.
 
can somebody star that?
 
That moment you realize they forgot the e.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Somewhere over the rainbow
@VoteToClose I assumed that was part of the joke.
 
@quartata le sigh
 
@CᴏɴᴏʀO'Bʀɪᴇɴ I mean that's literally the caption
 
6:29 PM
@VoteToClose yeah, it should be "tumbler"
 
It was. XD I just was mimicking your thoughts.
 
@quartata Oh. Haha?
 
Anyone else get a privacy error on esolangs?
 
I do.
 
6:31 PM
@undergroundmonorail Yeah.
 
Is this good reason to reject an edit that changes code? Editing would furnish an edit that would change the source code of the user, even if it is wrong.
 
@undergroundmonorail yeah, their certificate expired
 
I was getting some with meta codegolf a couple days ago too, but only from links in chat.
Speaking of meta
@CᴏɴᴏʀO'Bʀɪᴇɴ thoughts? meta.codegolf.stackexchange.com/q/7491/45151
 
@quartata Looking at it now ;)
 
6:32 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ It changes the original intent of the user.
 
@VoteToClose Yeah
 
@MartinBüttner
I apologize for not understanding the problem and the solution...
Mind explaining it so that a 14 year old would understand it?
 
@Stefnotch hi-five teens ftw!
 
high six
 
hey fellow kids, i'm a teenager still
i'm still cool until january
 
6:34 PM
@Stefnotch Given three 32-bit unsigned integers a b n, calculate (a-b)%n without running into any overflow issues and without casting it to a larger type
 
Overflow is OK as long as you get the right answer.
 
Hence "issues"
 
that's almost the opposite of Martin's problem
 
In what kind of cases would you run into such issues?
 
@aditsu ?
 
6:35 PM
Martin asked for unsigned.
 
^
 
Oh, sorry.
 
In all cases where a/b/n are bigger than whatever the max value for an unsigned int is?
 
@Stefnotch Well the initial values can't be bigger since they must be stored in an int already.
 
also, he specified the non-negative mod
 
6:36 PM
But a-b could be smaller than the limit for unsigned ints.
That would cause an underflow.
And the calculation of the modulo could run into overflows I believe.
 
@quartata See: comment on your answer.
 
Oh! How could the % cause an overflow?
(I get the a-b part of the problem.... :D )
 
Oh, I guess it couldn't with just unsigned ints.
Nevermind.
I think the underflow is the only thing you have to watch for.
 
@MartinBüttner ^^Is that correct?
 
@CᴏɴᴏʀO'Bʀɪᴇɴ:
[18:45:42] [Client thread/INFO]: [CHAT] Command set: /say 1
[18:45:44] [Server thread/INFO]: [@] 1
[18:45:44] [Client thread/INFO]: [CHAT] [@] 1
[18:45:50] [Server thread/INFO]: [VTCAKAVSMoACE: Game rule has been updated]
[18:45:50] [Client thread/INFO]: [CHAT] Game rule has been updated
[18:45:51] [Server thread/INFO]: [@] 1
[18:45:51] [Client thread/INFO]: [CHAT] [@] 1
 
6:46 PM
The best thing I could think of for (a+b)%n is to let c = n-n%b and then use the old algorithm to calculate a-c.
 
@VoteToClose Huh.
How about renaming the command block?
(And how would that be scored? >_<)
 
@VoteToClose @CᴏɴᴏʀO'Bʀɪᴇɴ I've updated the answer which should settle this
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Not possible - @ is the game name for no user.
 
@VoteToClose Oh, right. You're looking at the server log
 
It's possible in servers, but you'd have to edit properties, and it'll still prepend with [], not to mention breaking the game.
@quartata Ah, cool. :P Nevermind.
 
6:48 PM
Oh, shortest loop producing no output codegolf.stackexchange.com/questions/59347/… would be 0 bytes in MC?
 
@Stefnotch According to our rules, it's 2. See my answer on that page.
0
A: Shortest infinite loop producing no output

VoteToCloseMinecraft snap. Ver. 15w46a, 2 + 0 = 2 bytes Note that this version of this "language" was created after the question was asked. This is using this version of byte counting. Put inside of an always active repeating command block, it will, indeed, loop forever with no output.

 
But MC continues running even if there are no blocks at all...
 
Ah, but the command blocks/the language don't do a loop, just keep the system game running. And technically, it the game does have output if looking at the logs.
 
@Stefnotch MC is merely the system (think of it like the "OS").
The redstone you make in it is the program.
 
Oh! (Where are the scoring rules?)
 
6:51 PM
Linked in the answer I provided. c;
 
21
Q: Programming in Minecraft (Redstone) - how to measure program size?

mbomb007Since programs may be created in vanilla (un-modded) Minecraft using redstone to create logic gates (and more), someone could create such a program for a challenge on this site. How would such an entry be scored? Some possible scoring methods: Blocks used (placed redstone counts as a block) R...

 
Also, somebody has to start golfing in Terraria! :P
 
Is there an open demo version of the game?
 
Oh, crap...no.
(Well, there is always the "free" version of it. :P That "free" version exists for any game!)
 
Is it called piracy? XD
 
6:55 PM
You can run the game in singleplayer mode without an account, right?
 
@VoteToClose What did you want to discuss?
 
Is there a regex feature that will make the parentheses implicit in ((A?)?)?? i.e. make A{0,1}{0,1}{0,1} really mean ((A{0,1}){0,1}){0,1}? (@MartinBüttner..?)
 
This is as raw as images get. And even that has lots of metadata.
 
@feersum I was just suggesting that the conversation about Piet/MC scoring to be discussed here instead.
 
6:56 PM
It would be impossible to score like this since the bytes added like this are not always constant.
 
Actually, I'm not entirely opposed to scoring in pixels.
What I don't like is measuring in something that isn't bytes, and then calling it "bytes".
 
But we have to measure it in bytes, because command blocks contain text.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Terraria is being distributed using Steam/GoG...so, it is impossible.
 
We could call it blocks/text but that's semantics, really. It doesn't change the size.
 
@Stefnotch Oh. :P I haven't played the game.
 
6:57 PM
@quartata Is the entire Minecraft program a single string of text?
 
Nope!
 
@feersum I don't understand what you mean.
 
He means blocks != bytes
 
Right, but text = bytes
It's "mixed media"
 
6:58 PM
@feersum Technically, yes. c: nano Minecraft.jar.
 
I agree. blocks != bytes != codels
 
But the Minecraft program is not made solely of text.
It has a lot of other information.
You need to find a mapping of byte sequences to Minecraft programs, otherwise you are not measuring in bytes.
 
I'm an idiot
3
 
@quartata well redstone components != text
 
@Calvin'sHobbies I'm referring to command blocks.
I still don't see what this has to do with my meta post, at any rate. Mine has nothing to do with size.
 
7:00 PM
We need a .
 
If you want me to change "established" to "discussed" then fine
It's incredibly nitpicky (to the point of absurdity), if that's what you really are after.
 
hello all!
 
Hello!
 
Hiya @TanMath!
 
@feersum If I make an "interpreter" for Conor's scoring method, would that be OK?
 
7:01 PM
A program that takes a file and outputs a Minecraft world?
 
Yes.
 
@quartata I Seriously suggest against this.
 
Yes, that's what I am suggesting.
 
@VoteToClose It's basically what feersum is suggesting.
 
Yeah, but ew. You'd have to deal with chunk NBT.
 
7:02 PM
And it would get rid of this grey area.
 
Hello! [](http://@VoteToClose)
 
@VoteToClose NBT is actually really really simple.
 
@TanMath You fail.
@quartata Chunk NBT.
 
@VoteToClose come on!
 
@VoteToClose Yes, and?
 
7:03 PM
@TanMath you need a zero width space
 
¯\_(ツ)_/¯ Good luck; have fun.
 
@Calvin'sHobbies meaning?
 
Unicode Hex # 200b.
 
@feersum would this satisfy what you are asking for?
In the mean time, I'll change established to discussed
 
@VoteToClose well, i am on mobile, i don't think I can do such things looks like...
 
7:04 PM
If you want to talk more about this go to the size measurement thread not my unrelated input one
 
@TanMath You need a zero width space
 
@quartata More or less, although it does leave a lot of ambiguity with respect to I/O.
 
Copy this next message:
 
@feersum That's what this meta post is about.
 
7:05 PM
Right.
 
Mkay.
Now..
 
I learned how to silent ping :D 
Or YAW
 
Mirror mirror what's the best language for dealing with spaghetti binary
 
You win!
 
Did that work? ^^"
w00ts
 
7:06 PM
​​​​@quartata
So, how do silent pings work?
 
I also can null ping: @quartata
 
@Stefnotch The zero-space character is treated as a link body text, whilst the href is interpreted as a ping.

 
Copy the quotes and remove them: "" 
 
7:07 PM
Oh!
 
I would like to point out that this is a thing
I don't think it would be a good idea to use it though, since it is far too verbose.
We need something much more low-level (i.e what I'm about to make).
 
RPL ≠ Minecraft
 
@VoteToClose Basically.
 
Also, version support is going to suuuuck.
 
@Stefnotch
Can I ping myself?
 
7:09 PM
i give up!
 
@VoteToClose that's easy enough I'm just not supporting anything past 1.9
lmao gg wp rekt
 
Is it really better to have some blob of binary data than a verbose description?
 
(No...awww)
 
But seriously, I'll have one version for 1.8 and one for 1.9
 
Command block JSON changed in 1.9 (specifically from version 15w32b).
 
7:09 PM
you put the zero width space in the [] correct?
 
@feersum Yeah, because we need something that directly translates. Think of this like assembly.
 
RPL is more like C. (especially considering it has builtins that make stuff like clock lines)
2
Sure, you can use either if you want.
 
Also, different snap. versions broke JSON. (~-.-)~
 
But this'll be better for what meta agreed on.
 
7:10 PM
@quartata And builtins for tellraw, scoreboard, etc.
 
Yeah, exactly.
 
We should just make a text-version of RPL.
It would be easier >_<
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Also not really - you'd run into issues like making sure that command blocks count as 1 byte (smallest way I can think of requires 2, 4 for 1.9).
 
does chat support html?
 
@VoteToClose *easier to score.
 
7:12 PM
@TanMath Not really.
 
@TanMath No
Just some Markdown
 
ADVERTISEMENT:
5
Q: String to ASCII Art Text

VoteToCloseThe Task You are to write some ASCII Art Text as seen from this website for generating ASCII art! Rules Input will only be alphabetical text and spaces, and will be input as a single line. It is also case-insensitive. You needn't fix if the output text is longer than the terminal width. As lo...

 
@VoteToClose too hard.. not even going to try..
 
I would like to advertise my own, long-unanswered question:
6
Q: It's a double+ header!

Cᴏɴᴏʀ O'BʀɪᴇɴRelated Exposition After winning the SO raffle, you could have been on top the world, and you were! The raffle had been going on for a year, now, and you were one of a hundred programmers who were selected to enter into the SO stronghold. And finally, the wait is over. Today is the day you go t...

 
@CᴏɴᴏʀO'Bʀɪᴇɴ +1 for SOBAD.
 
7:16 PM
@VoteToClose :D Someone got it :D :D :D :D
sohappy
 
21
Q: Decimal concatenation of squares

TanMathPremise One night, I was just contemplating on numbers. I found out about something unique about numbers like 7, 10, 12, 13, and more. They are squares of squares! Meaning, that when squared, are comprised of squares themselves. The OEIS calls them Squares which are a decimal concatenation of tw...

 
@TanMath You have an answer already. (~-.-)~
 
@VoteToClose not many...
I was expcting more... like in python, c++, etc.
even seriously!
 
5 is plenty
 
@TanMath Seriously?
@Calvin'sHobbies True that.
 
7:18 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ Seriously!
@Calvin'sHobbies Seriously?
 
@TanMath Seriously.
 
ok then...
 
So is 21+ upvotes.
 
@VoteToClose You shoulda made it just about outputting H and I. I bet you'd have more votes and answers
 
@quartata I did some experiments - /tellraw does, indeed, output to client console, but not the server. /tellraw is directed at a player anyways.
@Calvin'sHobbies ¯\_(ツ)_/¯ May he who has patience win.
Welcome back, @RadRoman!
 
7:22 PM
This is the best use of truthy/falsy output I have seen: "For parenthifiable numbers, it will print one or more blocks. For non-parenthifiable numbers, it will crash without printing anything to STDOUT. " (by Dennis)
 
Gah Sorry @ETHproductions ! I am so tired atm.
 
@randomra Wow, that's really pushing the boundaries of the truthy/falsey rules, IMO
 
Tiny-challenge: Output any 3 distinct six-letter valid scrabble words, space separated. e.g. runner tanner toasts.
 
@TimmyD we have an STDERR (garbage) output doesn't cout ruling too, with that it seems okay
 
7:38 PM
@Calvin'sHobbies working on it :D
#0 3 @
 ; trailing newline
7 bytes
oh wait space seperated
$1 |>#0 3 @
r/.{6}/
19 bytes
 
Oh, hullo. I'm now way closer to 2000 rep than I realized.
 
Nice! And I'm way closer to 3k rep than I thought :P
 
@ETHproductions you could easily implement your own stringRepeat with Array.join for ES5-compatibility.
 
@Mego Seriously 3.0 should be Legit.
 
And 4.0 should be 2quit
 
7:49 PM
Simplex 2.0 should be... well, you know what I'm gonna say. c;
 
Smpler?
 
@VoteToClose ಠ_ಠ
 
It was during the Anagram scram.
MINICHALLENGE: Shortest code to output the string infinity (caps doesn't matter).
Vitsy can do it in 4 bytes. c;
 
1/0 - javascript
oh wait output
 
o-o That's not an arithmetic error?
 
7:53 PM
darn
@VoteToClose Nope!
Open up your console.
 
Vitsy: 10/N
 
Simplex: 1Vn
 
Huh. Interesting.
Vn does what? :D
 
1Vn
1   ~~ set current byte to 1
 V  ~~ divide the previous two bytes (zeroes infinitely leftwards)
  n ~~ output that number
 
Ooh, fancy.
 
7:55 PM
Yup! ^_^
Except Simplex is still unimplemented ;-;
Hopefully I'll be able to dev more over thanksgiving break.
#amurica
 
Is simplex stack-based?
 
Tape.
 
Tape/strip based, yeah.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Wouldn't this do 0/1?
 
@Stefnotch The issue is that a-b can be either positive or negative. So, naively, you have to use a signed type to store the difference. But a signed 32-bit type can only represent differences in the range [-2^31,2^32-1]. But the difference between to 32-bit integers can be larger than that (up to 2^32-1). This is why you can run into an overflow.
 
7:58 PM
Lemme check out the docs
V - Divides the previous byte by the current byte and removes the current byte, decrements pointer
Simplex is weird that way :P @VoteToClose
 
@feersum Is that supposed to be n - b%n?
 
So... that'd be 0 (previous byte) divided by 1 (current byte)?
 
oh wait
:P
Nevermind, I'm just tired.
 
@MartinBüttner Yes
 
o-o VTC is suspicious.
 

« first day (1752 days earlier)      last day (3081 days later) »