CMC: Print the numbers from 100 to 150, with each number repeated in a list 3 times. i.e. [[100, 100, 100], [101, 101, 101], [102, 102, 102], ..., [150, 150, 150]]
@Neil I was about to say "At least C doesn't do anything that silly," until I looked it up and found out that in C, ! is the same precedence as other unary operators like - and ~. Which is even sillier. [facepalm]
@Steffan Apparently it is normal for C. But that means for example that ! 2 > 3 parses as (! 2) > 3 instead of ! (2 > 3), which seems less than helpful. Compare C, Python, Pip.
@Steffan Yeah, that's the one problem with linking the code rather than the bytecount. :P
My opinion is exactly the opposite of yours, lol. :)
As with many of my programming-related opinions, it apparently stems from how QBasic does it... though with a twist: QBasic's NOT has lower precedence than arithmetic and comparisons, but it's actually a bitwise operator. :P
"A subset of QuickBASIC 4.5, named QBasic, was included with MS-DOS 5 and later versions, replacing the GW-BASIC included with previous versions of MS-DOS. Compared to QuickBASIC, QBasic is limited to an interpreter only, lacks a few functions, can only handle programs of a limited size, and lacks support for separate program modules."
Quickbaaic 4.5 wasn't compiled in any sense you would recognize
Given an undirected graph, find out if it is a tree.
A tree is an undirected graph in which there is exactly one path between any two vertices. In other word, the graph is both acyclic and connected.
Input
You can take input in any reasonable format. Here are some example formats:
an adjacency m...
yo how yall getting like close to 1000 rep per week (1/5 of my total rep lol), ive literally been posting a gajillion answers this past week, basically way more than usual, and i still only have like 600 rep this week
like bubblers at 1100 this week already, its still friday
That, or you make your own golfing language, grow a community around it for a year and a bit and watch the upvotes start coming in when you use your golfing language
Simplify a Cycle
code-golf graph-theory
Given a path of vertices that form a cycle on a graph, output a simple version of the cycle.
Rules
There will always be a simplier cycle in the input
There will always be at least 2 vertices
Each vertex has degree >= 2
Input and output can be given in a...
> The supplied fortune databases have been attacked, in order to correct orthographical and grammatical errors, and particularly to reduce redundancy and repetition and redundancy. But especially to avoid repetitiousness.
@thejonymyster Scala, 61 bytes: Stream.from(2).scanLeft(Seq(1))(_:+_)flatMap(_.tails.flatten) (Scala Seqs actually provide an inits method to get prefixes that could replace the .scanLeft(Seq(1))(_:+_) if it weren't for the fact that they go from the largest prefixes to the smallest >:|)
Ugh, the best I could get in Coconut was 123 bytes (partly because the documentation claims flatten is a builtin but whatever version of Coconut their online interpreter and TIO have doesn't have it)
LDQ: so as yall know, Fig is a functional language. I have a tradition of putting the "main" operand last in an argument list, so that i can take advantage of any implicit inputs. should i do this for division? for example, /xy would mean y/x
rn it means x/y
itd be convenient to immediately terminate the program by /0 instead of /00
(termination isnt the only use case, i.e. reduce puts the reduced stuff second)
i feel like the average golflang is sort of a half-dsl because i wouldn't say that golfing itself is a very specific domain but they still generally have pretty limited facilities for practical kinds of things that do happen to fall outside the general scope of what challenges tend to be
An embedded DSL is when you're still using Groovy or JS or what have you, but you make a bunch of handy functions specific to some task so it almost looks like a different language
hell they're almost anti-dsls like usually a dsl is for generalizing something specific and structured you do a lot of but golflangs are about flexibly expressing core logic to the exclusion of being particularly good at any real class of things outside the meta level of golf
hyper-efficient encodings will never fully take over because they're aesthetically inferior so i feel like there's room to specialize one way or another
something like read grid as (int with space) with newline
and it would be on the type level for maximum convenience-at-the-cost-of-cleanliness while also encouraging ad-hoc types to catch stupid logic errors to reduce actual debugging
and honestly something like that could also be nice for general utility scripting outside a competitive environment too
like perl without being anything like perl :P
something too expressive for its own good
thinking it could somehow also be stack-based despite being statically typed