« first day (2453 days earlier)      last day (2383 days later) » 

12:01 AM
Anyone here good with C#? I need some help. How do I covert a given method to an object of type Delegate, given I don't know what parameters it takes?
(Basically I need to convert a method into something I can call DynamicInvoke on)
 
12:17 AM
I opened a .jpg file as text and parts of it look like Vim and other parts look a lot like Jelly :P
more so Vim because it has accents rather than dots.
 
I tried to open one with Sublime Text but it just correctly opens it as an image.
 
oh lol
 
12:29 AM
lol Java is such a pain to use
I figured out how I'd do the next OEIS sequence already
if I were using Python I'd probably be done by now yet I haven't even gotten around to the main part of it yet because too much boilerplate
Why, i cri everytim, why...
 
Solution: Don't use Java
 
Any suggestions then?
I don't know many languages :P
 
C|C++|C#?
 
I don't know any of those.
I've been meaning to learn one of them for a while but I never got around to really learning it.
 
I recommend learning C/C++ Some time, it's really worth it.
 
12:35 AM
I know a few things and I could make a Hello World program but not really too much
@ATaco C# isn't that great?
 
C#'s rather different.
A lot closer to Java than the other Cs.
But C and C++ is great to learn to understand pointers and similar memory management stuff.
 
Ah okay.
Which one would you recommend for someone who knows Python and Java mainly?
 
If you know more Python than Java, C++, if you know more Java than Python, C#.
 
Okay. C++ then. Thanks!
(which is the one with the std::cout << "Hello, World!" << std::endl; syntax?)
I recall it being cpp but not sure
 
Yes.
 
12:37 AM
Yeah.
Although you can use printf("Hello, World!") if you import stdio.h, but it's not recommended/good practice.
 
Ah okay.
And C had puts(stuff); right?
 
It's not that C++ doesn't have puts and printf, it's just that C doesn't have the iostream library, so it doesn't' have std::cout <<
 
oh ok
Also, is using namespace advised?
 
Some places say use it, some say never use it.
I agree with never use it.
 
ok
is goto recommended? :P
Also, should I add this syntax to Proton? statement while condition then endstatement => while condition {statement} endstatement
 
12:41 AM
There's always a reason to use goto, but it's never a good reason.
 
Consider that Java doesn't have goto, (I think) the only time you should use it is to break from nested loop.
 
Ah okay.
 
@user202729 Still not a good reason.
 
Are there loop labels in C? That's the main reason I never needed goto in Java
<insert relevant xkcd>
 
No, unfortunately.
 
12:42 AM
darn
(I realize that the then is unnecessary because I could just replace it with a semicolon, but then that wouldn't be a single statement and braces might be required)
 
goto label;
..
.
label: statement;
 
Is there any better way? Return from function?
 
@user202729 Use a boolean, manually break your level. If you're more than 2 levels deep, consider changing your structure, or return from a function.
 
Loop labels are one of the few things I like about Java over Python.
2. My expectation that the feature will be abused more than it will be
used right, leading to a net decrease in code clarity (measured across
all Python code written henceforth). Lazy programmers are everywhere,
and before you know it you have an incredible mess on your hands of
unintelligible code.
Regardless of how elegant your programming language is, when faced with PPCG, no language can stay beautiful forever :D
Except Jelly. "Jelly is a form of pure art" ~ someone in JHT
 
Brainfuck is beautiful in how ugly it is.
 
12:49 AM
yup :P
 
1:22 AM
goto is useful when you're developing in assembly language and cannot use loops
 
1:45 AM
goto is useful when there is no other options.
 
I made extensive use of goto in my early days of TI-BASIC to allow do{code}while(condition) until I found repeat(.
 
MaybeLater has the best control flow.
 
@ATaco [citation-needed]
or just proof
or just examples, too :P
 
2:03 AM
local returning = 0
when fib is *{
	if(1-returning){
		if(fib >= 2){
			local n = fib
			local a = fib = n - 1
			local b = fib = n - 2
			returning = 1
			fib = a + b
			returning = 0
		}
	}
}
@HyperNeutrino
 
ooh
but I mean that doesn't show me anything about control structure except the when fib is * part. What does that mean, btw?
 
That is 100% of the control structure. It's assignment based events.
 
hm. I don't quite get this rip.
 
when fib is * assigns this block to an event that fires whenever fib is set to anything.
 
No break/return?
 
2:04 AM
oh what
that is so cool
 
That sounds rather inefficient
Also kind of like COMEFROM
 
lol
anyway brb gotta go deal with something probably quickly
 
It's incredibly inefficient, but it works.
 
Do you mind if I steal that idea for Proton? xD I find that a really cool concept.
(I'd probably fail at it though so rip)
 
Go for it.
 
2:10 AM
Basically seems to be subscription based stuff for variables
Does seem kind of cool though :P
 
Essentially is.
And you can cheat and make functions this way.
 
Wait x is * is an expression in and of itself?
So wait, is when condition a control statement that is executed whenever the condition is matched or something?
@ATaco Is that a cheat for constants :P
 
when takes an event variable, and x is * produces one of these variables.
 
Huh okay.
How are event variables checked? Is it verified at every layer of evaluation or does it report to the event variable when its condition is matched?
 
The assignment event is particular in that it attaches it to a scope, then when an assignment occurs to a variable, it checks for any attached events in that scope, and fires them if their condition is met.
 
2:18 AM
Hm okay.
So are there any event variables other than <ident> is <expr>?
 
There's also <expr> <timeunit> passed
 
hm ok
so like when 2 seconds passed { print ("hi"); } would print "hi" after 2 seconds from the start, right?
 
(Got the name of the thing wrong)
 
oh ok
(wait can't you pluralize "second"?)
 
You can in the latest version, not in TIO's version.
 
2:30 AM
ah ok
 
And you can repeat something every x seconds by combining assingment events.
when x is 1{
	print("Loop forever, slowly...")
	when 1 second pass{
		x = 1
	}
}
x = 1
 
Huh interesting.
Wait you could do like anything with these when statements. Nice!
 
Yep, MaybeLater is TC.
 
What other control flow things do you have?
whoops gtg now o/
 
o/
 
2:53 AM
@ATaco Wat. You'd implement Fibonacci as recursion but factorial as for loop???
@DJMcMayhem Well of course, it has to return 1 F(n) times
 
The Factorial recurrsion function is just the for loop version in disguise.
 
@ATaco ... Same as Fibonacci...
 
Alright, without referecing an implementation, explain both the functions.
 
Explain?
Without referencing an implementation?
f(n) = f(n-1) + f(n-2); f(0) = f(1) = 1
fac(n) = n * fac(n-1); fac(0) = 1
Magik
 
I would explain Factorial as "The product of all numbers up to N" And fibonacci as "The sum of the previous two fibonacci numbers, where the first two numbers are 1."
I explain Factorial linearly, and Fibonacci recurrsively.
 
2:58 AM
@ATaco You can only explain factorial like that because of the magic word product...
@ATaco Factorial is "The product of the number and the previous factorial" or something like that
 
I don't use recursion to get the product of a list :P
Anyway, the most important thing is that the for loop is faster.
 
@IanH. what u need?
 
@ATaco Same for fibonacci... (well for fibonacci the for loop is exponentially faster)
 
I've never been consistent, or non-hypocritical.
I have succeeded in making Ackermann in a While loop though :D
 
I think the word u guys are looking for is tail-recursive
factorial's recursive implementation is tail-recursive which means its basically trivial
 
3:02 AM
Tail-recurrsion is rather different from recurrsion.
 
yeah
i'm saying that factorial is tail recursive
fibbonacci isn't
 
that's the distinction @ASCII-only was trying to make
 
@ATaco It's not hard to change a for loop to a while loop >_>
 
As long as it doesn't take 29 seconds to calculate 36! :P
@ASCII-only Ackermann is not something generally written in a for loop...
 
3:05 AM
@ATaco But that doesn't mean it's very hard at all...
 
I never said it was hard.
I did it by just manually implementing recurrsion.
 
@orlp Would adding a second pivot help at all?
> I have succeeded
Well you make it sound like it's hard >_>
 
Show me your implementation then :(
 
:|
Ackermann is confusing
 
What's wrong? Is it Hard?
 
3:13 AM
No
@DJMcMayhem Also demonstrating the insane power of memoization :P
@Adám Even better, e-ink (or color e-ink?) to save power :P
 
3:43 AM
:D successfully reinstalled my OS's file manager!
I'm always worried that those sorts of things will go terribly wrong.
 
Try /bin/rm /bin/rm next time
 
4:14 AM
Hey I have a question, if I post a suggestion on the sandbox that's well-received, is it possible for me to request that someone else actually write the challenge? I don't care that they would get the rep, but I have an awesome and elaborate idea and I don't feel that I have the personal time that would do it justice.
 
Go for it, as long as you have an agreement.
 
4:42 AM
@orlp I think I was going to let Peter do that
 
5:14 AM
@Downgoat I came across your babel plugin recently, and I like the idea. Have you considered adding support for inlining functions, if their definitions are available in the AST at compile-time?
 
0
A: Sandbox for Proposed Challenges

Patrick RobertsPokémon Champion king-of-the-hill decision-problem game internet* This challenge is about writing the ultimate bot for battling Pokémon. Since knowledge of competitive Pokémon battling is necessary, I'll leave that to the experts at Smogon University. Rules Your bot must battle another bot i...

 
6:15 AM
Useless language idea: When an array is stringified, Output it with an and, Eg. [1, 2 and 3]
 
 
2 hours later…
8:06 AM
@ASCII-only not in practice
 
8:20 AM
**CMC**: Solve the easiest challenges (+, *, ==, Hello World) on PPCG.SE.
Rules:
+ _Programming environment: non-programmable calculator._
+ `==` must return consistent values for truthy and falsy.
+ Hello World is case-insensitive.
 
8:42 AM
0
Q: Ten-row bar chart

AdámThis is Hole-1 from The Autumn Tournament of APL CodeGolf. I am the original author of the problem there, and thus allowed to re-post it here. Given a list of numbers, produce a horizontal bar chart of # characters for how many numbers fit into each of ten equal-sized groups. For example, if t...

 
9:02 AM
@user202729 ==? Also, markdown is not available in multi-line messages.
@user202729 How do you count submission length on a non-programmable calculator? Key presses?
 
A bigger question is how to output "Hello World" on a calculator
 
Forgot that part. Each key press or switch etc. count as 1 byte. Because not very much calculator have >256 bytes that would be good enough.
@someone That's what you have to think about.
 
9:25 AM
@Adám Could you add a worked example for your challenge? I find myself in trouble understanding it.
Maybe I am just dumb :)
Nvm, I think I got it.
 
10:13 AM
@user202729 :| How to take input
@user202729 It's not possible
@user202729 Non-programmable?
 
@ASCII-only Hardcode, just like in ///. Most creative solution win. Nevertheless there exists nonprogrammable calculators that can prompt for input.
 
@user202729 Then wouldn't +, * and == be +, × and = respectively?
And Hello World not possible
 
@ASCII-only speaking of taking input, what's the best way to input a list of integers in Charcoal?
 
10:28 AM
@Neil :| idk
@ASCII-only I should really add python literal input
 
@ASCII-only Is there such key =? On which calculator?
 
@user202729 CASIO scientific calculators
 
hmm...
non-programmable?
 
Yeah?
 
so, + and * are simply a+b= and a×b=
 
10:31 AM
But is that used for equality comparison? I don't think so.
 
hello world is impossible
 
@user202729 No, his = is EXE
Or w/e it is on scientific calculators
@user202729 Yes
@user202729 ÷ would do the same thing though
 
Hello World is possible. Should I post a proof image?
What about ==?
 
I think == can be a-b÷= with error for true
@user202729 you mean the "upside down" thing?
 
@EriktheOutgolfer That can't give W
@user202729 Yes please
 
10:35 AM
> True/false must be consistent.
In other word the set of truthy values/falsy values must have exactly one element each.
 
@user202729 What about it?
 
@user202729 but they are
 
Are 1 and an error not consistent?
 
you get 1 for false and 0 error for true
 
Indeed. I just not using your calculator. No problem.
 
10:36 AM
what calculator doesn't work
@user202729 yeah
 
wait just ÷ doesn't work
 
yes you need the = to make them consistent
 
still no
 
Huh?
 
10:45 AM
you can't just do a-b=
 
Yeah
But I misunderstood the "yes you need the = to make them consistent"
@Mego You mean one of the class names right?
 
@DJMcMayhem C++. It's just awful. Swift is nice but can get rather annoying sometimes too.
 
@ASCII-only The equivalent on Casio esplus / ex series is (a-b)÷(a-b)
 
@DJMcMayhem Brain-flak because bracket imbalances are annoying Malbolge because it's just a pain (ADJUST to a lesser extent). On a more serious note, Java - it's more terrible than C# in about everything, or C because manual memory management
 
Or, in less keystrokes: <a>[-]<b>[=][÷][Ans][=] (5 keys)
 
10:51 AM
wait can you do parentheses
 
It depends on the calculator you uses.
 
0
Q: Did you hear about alphametics?

0x45Task The letters spell out actual words, but if you replace each letter with a digit from 0–9, it also “spells” an arithmetic equation. The trick is to figure out which letter maps to each digit. All the occurrences of each letter must map to the same digit, no digit can be repeated, and no “wor...

 
11:21 AM
@DJMcMayhem Python 3, 69 bytes Try It Online!
Ugh, the new top bar messed up the userscript. Now you cannot change the settings of the userscript, and Sandbox viewer doesn't work anymore.... :(
 
11:59 AM
1
Q: Square pyramidal numbers

Felipe Nardi BatistaA000330 - OEIS Task Your task is simple, generate a sequence that, given index i, the value on that position is the sum of squares from 0 upto i where i >= 0. Example: Input: 4 Output: 30 (0^2 + 1^2 + 2^2 + 3^2 + 4^2) Input: 5 Output: 55 (0^2 + 1^2 + 2^2 + 3^2 + 4^2 + 5^2) ...

 
Anonymous
@AdmBorkBork I love everything about that sentance
 
Who (used to be) ՊՓԼՃՐՊՃՈԲՍԼ?
 
dim
I'll award my last bounty to the Tetris answers tomorrow, if anybody wants to follow with some more bounties. This has cost me an arm and a leg, but it was really deserved.
 
1:15 PM
I was slightly confused as to why my rep counter went up a load until I finally noticed I got one of those bounties :3
 
dim
I'm suprised you could have been surprised. You probably expected a few bounties when you posted the answer, weren't you?
 
@muddyfish I think I'll put a bounty on your answer too after this massive wave of +500's, since you received fewer bounties than the other crew members
 
Well I was expecting one at some point but I'd kind of forgotten about it after a while :P
 
:o it's the first I don't see any mod in chat, or at least grayed out.
 
:O
 
dim
1:21 PM
Anyway, well done again, guys. At some point, I thought I could finish what I started to make, but I took too long, and I moved on with something else... I'm glad it got answered, though.
 
Anonymous
@Mr.Xcoder molarmanful aka Mama Fun Roll
 
Anonymous
@dim We actually organized the posting of the answers in anticipation of bounties :P
 
Anonymous
@Mr.Xcoder Yep
 
Ok thanks!
 
1:32 PM
0
A: Sandbox for Proposed Challenges

Simply Beautiful ArtOutput the simplified Goodstein sequence. sequence code-challenge A number is in base-b simplified Goodstein form if it is written as b + b + ... + b + c, c < b The simplified Goodstein sequence of a number starts with writing the number in base-1 simplified Goodstein form, then replacing ...

 
Should I add to my proposal?
 
@SimplyBeautifulArt 1. should indeed be added. Why is it a rather than ?
 
@SimplyBeautifulArt yeah, and I also think the explanation is kinda confusing.
 
yes you should clarify.
 
hi everyone
 
1:40 PM
Hm... I guess would work
 
Hi Hyper
 
I have some progress on the most recent OEIS sequence:
 
Sup Hyper
 
(click expand to full text)
https://tio.run/##nVhZb9s4EH52fgXbh9ZqFG@SAvsQH4u26AIFukDRpvtiqIBsMwltWdJSUo5tvX89OzMkRVKH4zYPscg5OJzj45Dr@DY@yXKerlebx0exzTNZsjVMjqpSJKM3UsYPxfioRfgoirJjmvgV7SheFKWMlyUTacnlVbzk7G2WJTxO32XbhUi5ZN@PBjXXQtHYUhGHZpzwqzKsqVJc35TB@GjXqf/9P1WciPJhchmyr7NO9RxZiuGl1vvV1bhM4qJgn2IhJx9D9pkUfGTJ@GjwmUnY0SCvFolYEscQCMDDZIBcg/JGFKOETYlbjSSMQGqwGwys8r9ikaJAUcYlaLrNxIrlEnZg9juP5hHbxqUU90rzVSaZJTKZ3bELj8HjYByowKNJgy8PRcm3o6wqR2oZzv5gZ8BzGoy7GV6yl4q0O@ogJ@mQqECEPZltWPMa0YMZL364AfR32EqFK2Ux@IhDRqHQKOHpdXnDplMlo8e4uqONF1VSgqdTflcv4khHY@NCMJ4JYDwdw89ECxqdTBwfB3puLiJguxqZraA2mAuVFfB
 
@HyperNeutrino I got an empty code here
 
1:41 PM
CMC:
in Jelly Hypertraining, 55 mins ago, by Mr. Xcoder
CMC: Compute the first N even triangular numbers.
 
@J.Salle Did you click "see full text"?
 
@J.Salle You must see the full text of the message for it to work.
 
@HyperNeutrino nope, hahahahahah
 
ಠ_ಠ :P
 
@HyperNeutrino What are you doing with OEIS sequences?
 
1:42 PM
One OEIS after another challenge
 
ಠ_ಠ Octave nearly ties Pyth
 
That's a whole bunch of lines, what is the sequence?
 
Number of nonisomorphic minimal triangle graphs.
 
@J.Salle How about now?
 
@HyperNeutrino Since it only has a few known terms, why not hardcode it? [1, 1, 2, 4, 9, 19, 48, 117, 307, 821, 2277, 6437, 18634, 54775, 163703, 495529, 1518706, 4703848, 14714754, 46444979, 147832051, 474229588, 1532565644]
 
1:45 PM
Because it's infinite
 
oh nvm
 
@Mr.Xcoder You'd have to hardcode at least 1000 terms unless it's a finite sequence.
 
@SimplyBeautifulArt way better IMO
 
Okay, thanks.
 
There's a slight problem with my current code though; it seems to be missing one of the graphs for order 6 (graph 2 from the left here)
 
1:47 PM
@HyperNeutrino completely unrelated but they look like fat fish, lean fish, triforce and spacecraft, in that order
 
I agree.
:P
 
Anonymous
6 messages moved to Trash
 
My approach is to start with a graph of order nodes with no edges, and then essentially BFS all steps adding a cycle to the previous graphs each time until all end graphs are connected.
 
Anonymous
Please avoid excessive smileys/emoticons/whatever you want to call that
 
@Mego I hoped someone would trash those. Sorry.
 
1:49 PM
@icrieverytim I blame you for my troubles; I have to use Java because you used all of the Python versions :c :P
 
@HyperNeutrino So you are writing a program for calculating that sequence in Java?
 
Anonymous
@Mr.Xcoder Smileys at the end of an otherwise not-noise message aren't really a problem. Smileys in place of real messages can be.
 
Well it's only two and it's inline; those took up a whole 5 lines because they were separate.
@user202729 Yes. That's the current challenge.
 
@Mego okay, sorry.
 
Can anyone help brainstorm potential reasons my code is missing the lean fish graph?
 
1:51 PM
I'm out, I am parallel with graph-theory.
 
@Mr.Xcoder I'm orthogonal. We've crossed paths once, but I never saw it again.
 
You mathematicians...
 
Yes us mathematicians :P
 
I'm a closed meander. I keep running into it and it's always just going back to the same problems...
 
1:55 PM
I've never studied graph theory, so I know next to nothing about most of it
 
Anonymous
I'm a penguin. I'm not even in the same realm as graph theory.
4
 
Should I mention that the shortest code wins, or can I leave it out since I have the tag ?
 
Anonymous
@SimplyBeautifulArt It's not necessary, because implies that.
 
I've just seen the most obfuscated math.se post ever ಠ_ಠ
 
@Mego what?
 
1:56 PM
Okay
 
@SimplyBeautifulArt what Mego said, although a lot of people add it anyway
 
Anonymous
@EriktheOutgolfer What else could possibly be the win condition for a challenge?
 
I thought it was consensus to mention something along the lines of "this is , shortest code wins"?
 
@Mr.Xcoder Bet I've seen worse :-)
 
Anonymous
@EriktheOutgolfer Some people do it, but it's not required. The tag implies the win condition. Some people just like to make it explicit.
 
1:57 PM
Meh, can't hurt to mention it I suppose.
 
@Mego Actually the consensus is that it's needed (to ease the understanding of new users). Let me find the link.
 
Anonymous
But it's golfier without :P
 
What, are we golfing our challenges now too?
 
1:58 PM
@Mego I heard you like golf, so I golfed the question
 
Anonymous
@Mr.Xcoder Huh, I never saw that post.
 
Anonymous
I never put "shortest code wins" in my challenges, so shrug
 
so it is a consensus, and it's just that it's not strictly enforced
 
I put it about 70% of the time. I'm very inconsistent :P
 
Anonymous
It's a "should" consensus, not a "must" consensus
 

« first day (2453 days earlier)      last day (2383 days later) »