racket-nonogram can now show you any mistakes you’ve made, in case you can’t figure out what the issue was and don’t want to have to completely start over
Posts by Alexis King
racket-nonogram now supports automatically generating “mega nonogram” puzzles from standard puzzles
;; fill-forced-tiles-in-mega-span! ;; : mega-tiles/c mega-placement-bound? mega-placement-bound? ;; #:set-full! (-> mega-index? any) ;; -> (values natural? line-affinity? line-affinity?) ;; ;; Given two mega placement bounds, fills any tiles forced by crosses along the ;; path bridging the two bounds. For example, suppose we have the following row: ;; ☒☐☐☐☐☐☐☒☐■ ;; ■☐☐☒☐☐☐☐☐☐ ;; This function will fill any tiles that must be filled to connect the two ;; filled boxes: ;; ☒☐■■■☐☐☒☐■ ;; ■■☐☒☐☐■■■☐ ;; ;; Along the way, it also calculates and returns the minimum number of tiles ;; that must be filled within the span, taking existing filled tiles into ;; account. It also returns two line affinities that can be used to calculate ;; the minimum cost of extending a placement with the given bounds backwards or ;; forwards, respectively. For example, given the row ;; ☐☐■☐☒☐☐☐ ;; ☐☐☐☐☐■☐☐ ;; then the results of this function applied with bounds (mega-placement-bound 0 2) ;; and (mega-placement-bound 1 5) will be as follows: ;; ;; 1. The returned minimum size will be 5, as at least 5 tiles must be filled ;; to bridge the two bounds. ;; ;; 2. The first line affinity will be #f, as one possible way to bridge the ;; two bounds is ;; ☐☐■☐☒☐☐☐ ;; ☐☐■■■■☐☐ ;; which fills both tiles in the first column. Therefore, it is possible to ;; extend the filled region backwards to either line at equal cost. ;; ;; 3. The second line affinity will be 1, as filling the tile in the first ;; line above the end bound would require filling 6 tiles, not five. ;; Therefore, extending the filled region forwards is biased towards the ;; second line. ;; ;; Note that the way this function interprets bounds with line 'both or 'either ;; can be somewhat counterintuitive; see Note [Filling forced tiles between ;; placement bounds] for an explanation.
This function is used in two different ways: 1. It is used to bridge the first and last filled tiles in a mega clue. When used in this way, the bounds always refer to a specific line, never 'both or 'either. This is the mode in which the return values are utilized. 2. It is used to fill tiles forced by the intersection of the earliest and latest tightest placements for a clue (or the intersection of one such placement and a filled-in tile). This mode is called purely for its side effects. The interpretation of bounds supplied in the second case can be somewhat counterintuitive, as they represent the greatest lower bound and least upper bound for a clue’s placement, not tiles that must necessarily be filled by the placement. For example, suppose we have the following empty row for a mega 6 clue: ☐☐☐☐ ☐☐☐☐ When we calculate the earliest and latest placements for this clue, we will get the following two results: ▧▧▧☐ ☐▧▧▧ ▧▧▧☐ ☐▧▧▧ The earliest placement has an end bound of (mega-placement-bound 'both 2) and the latest placement has a start bound of (mega-placement-bound 'both 1). The intersection of these bounds yields the following span: ☐▧▧☐ ☐▧▧☐ This function will be called to fill any tiles forced within that span. Given the fact that the bounds specify 'both lines, it would be easy to mistakenly believe that all four tiles should be filled. However, that would be completely wrong in this case, as the bounds do not specify which tiles are (or should be) filled, they simply define the region inside which forced tiles *may* be filled. In this example, there are no forced tiles, so the proper behavior is to do nothing at all. A natural followup question is to ask what the difference is between a bound using 'both and a bound using 'either, or indeed what the difference is between such a bound and one using a specific line. The answer lies in what we consider to be “forced” at the span endpoints.
;; Note [Forced mega span endpoints] ;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;; Endpoints of the span must be handled specially. Normally, we fill tiles ;; in one of the following shapes: ;; ■■■ ☐☒☐ ;; ☐☒☐ ■■■ ;; This corresponds to the span having to snake around a cross. However, at ;; consider the following row: ;; ☒☐☒☐☐☐☒ ;; ☒☐☐☐☒☐☒ ;; Suppose the span starts at the top left empty tile and ends at the bottom ;; right empty tile. If we only fill tiles in the above patterns, we’ll end up ;; with the following: ;; ☒☐☒■■■☒ ;; ☒■■■☒☐☒ ;; But this is missing the tiles at the ends! However, we don’t want to fill ;; the bounds unconditionally. Suppose instead we have the following row: ;; ☐☐☒☐☐☐☐ ;; ☐☐☐☐☒☐☐ ;; If the start and end locations are still the same, the tiles at the ends ;; are no longer forced. On the other hand, if we have the row ;; ☐☐☒☐☐☐☒ ;; ☒☐☐☐☒☐☐ ;; they *are* forced. Programmatically, the necessary conditions are: ;; ;; 1. The bound must cover 'both lines. ;; 2. The opposite tile must be bounded behind or afront. ;; ;; Somewhat counterintuitively, the second condition is all that matters, and ;; it holds regardless of whether the bound is the start bound or the end ;; bound. To illustrate, consider the following examples: ;; ☐☐▧☐☐ ☐☐▧☐☐ ;; ☐☒☐☐☐ ☐☐☐☒☐ ;; In both examples, ▧ represents a tile in one of the bound columns. ;; Regardless of whether we are filling from the left or the right, if the ;; bound’s line is 'both, the ▧ tile must be filled.
;; It is time to try to fill in boxes using the usual left/right ;; solve strategy. However, for mega clues, this is substantially ;; more complicated. We have to consider two cases separately: ;; ;; 1. If the earliest/latest placement overlaps with an existing ;; filled-in tile, we want to “extend” the filled region to the ;; placement’s bound. For example, suppose we have a mega 5 ;; clue in the following row: ;; ☒☒☒☐☐ ;; ☐■☐☐☐ ;; Since the earliest placement’s end bound is larger than the ;; filled tile, we want to fill any tiles forced by crosses ;; from the tile to the bound: ;; ☒☒☒☐☐ ;; ☐■■■☐ ;; ;; 2. If the earliest/latest bounds overlap, we want to fill any ;; tiles forced by crosses between them. For example, suppose we ;; have a mega 5 clue in the following row: ;; ☒☐☐☐☐ ⇒ ☒■■■☐ ;; ☐☐☒☒☐ ⇒ ☐☐☒☒☐ ;; ;; It might seem as though tiles filled by the second rule would ;; always include those filled by the first, as long as we’ve placed ;; crosses appropriately to limit the size of the hole. Unfortunately, ;; this is not always true, at least with our current algorithm for ;; selecting an earliest/latest placement. For example, suppose we ;; modify the first example slightly: ;; ☒☒☐☐☐ ;; ☐■☐☐☐ ;; Here, there is no overlap guaranteed by the bounds alone, so if ;; we didn’t have any filled-in tiles, we wouldn’t be able to gain ;; any information.
while working on this I have begun to understand why there are no mega picross implementations on the internet
not all puzzles can be solved purely with line-by-line logic alone! in fact, a few of the included example puzzles cannot be solved that way :)
racket-nonogram now supports networked co-op multiplayer (and has a README) github.com/lexi-lambda/...
it also supports mega picross-style puzzles now (I have not seen any other implementation of this in existence outside of the switch picross games)
wrote a few paragraphs today about why early Stack Overflow was such a special and rewarding community to contribute to and why so many of us who were there have never really stopped mourning its slow but steady decay meta.stackoverflow.com/a/438314/465...
working on a nonograms implementation in racket based on the switch picross games github.com/lexi-lambda/...
BNF from https://docs.racket-lang.org/rhombus-reference/class.html#%28def._%28%28submod._%28lib._rhombus%2Fprivate%2Famalgam..rkt%29._core%29._class._rhombus%2Fdefn%29%29
Body text from https://docs.racket-lang.org/rhombus-reference/class.html#%28def._%28%28submod._%28lib._rhombus%2Fprivate%2Famalgam..rkt%29._core%29._class._rhombus%2Fdefn%29%29
mflatt: let’s ditch s-exps to make our language more accessible :)
also mflatt: rhombus defines eight different ways an identifier can have a binding in the core language and the standard library adds several more. here is the documentation for how to define a basic datatype. do you like this
really cool that stackoverflow-the-company is making such terrible choices that it’s gotten a wine mom with a radio and film degree to start fedposting in their moderator-only chatroom
Screenshot from langdev stack exchange chat that reads: “DannyNiu: Hi all, apologies for 2 poorly-received Q in a row. I'm experiencing some sort of "new-year" mind vacancy, and couldn't think straight.”
who else up experiencing some sort of "new-year" mind vacancy
it turns out to be a pretty big problem for internet “communities” how many people absolutely love feeling righteous anger and like to find as many opportunities as possible to be as mean and uncharitable as they want without feeling guilty
I agree! I think the default HTML renderer is not very helpful. I think it would be reasonable to ship a stripped-down HTML renderer (similar to (blog-render-mixin base-render%) in my blog code) in Scribble itself. It would also be nice to make a custom renderer easier to actually render with.
In my blog, I don’t just render posts to xexprs. Rather, I render posts to a data structure that includes the post date, tags, and the top part for index pages and RSS feeds. Links to both other posts and external Scribbled docs are stable. Footnotes are automatically collected out of the main flow.
In practice, it does seem like “@-expressions as a templating language for xexprs” is really what plenty of people want, which is fine. But Scribble is much more than that, and I find a lot of what Scribble provides to be tremendously useful.
I do not think Pollen is “all the good bits with minimal hoops”. Pollen is essentially just @-expressions as a templating language for xexprs. Scribble is an extensible document model with a multi-pass rendering process that supports cross-references and other cross-document information flow.
You can make Scribble output almost anything, but it requires a decent amount of code, and it’s not well documented. My blog is generated with Scribble, and it doesn’t look anything like default Scribble output. My renderer is here: github.com/lexi-lambda/...
love this completely insane guy who makes incredibly thorough, four hour long strategy videos for twenty year old mario party games for no discernible reason www.youtube.com/watch?v=Sndv...
“soundtrack is way better than the soundtrack to an extremely mid video game ought to be” is a shockingly common phenomenon
he’s not even really anonymous; his bio references his other account which contains his full name and links to his personal website
Threads of tweets by @Ngnghm. Lexi also complains about lack of female Haskellers. But Haskell recruits at the higher end of the IQ spectrum, and especially the math part of it. Between extra variance and skew towards shape rotators vs wordcels, males vastly dominate this population. Extra variance means that males dominate both ends of the Bell curve for a lot of traits, from intelligent vs stupid to heroes vs criminals. Unsurprisingly, a lot of the few women we find in these circles have obviously been exposed to a lot of testosterone during their development. The human sexual dimorphism in cognitive abilities, behavior and preferences is obvious and ubiquitous despite the egalitarian religion destroying the West currently making its mention taboo. Expecting equality or making it a goal is absurd, self-defeating, and, frankly, evil. Instead, outliers should enjoy their status as such. “One good Husband is worth two good Wives; for the scarcer things are, the more they're valued.” — Benjamin Franklin Moreover, as a programmer, you're already an outlier in abilities and interests. And if you read this post, you're an outlier among these outliers. If you're female, even more so.
jesus christ
Yeah, that’s sort of what I meant by “the UI has value”; it’s useful to have an interactive dialogue of some kind. But there are lots of other ways we have tools provide interactive dialogues (one of them being literally called dialog boxes) and I would like to see more exploration there.
The UI is like that, but a lot of that is set dressing doing everything possible to create the illusion of working that way, which is why I’m not super fond of the framing. I do think that obviously the UI has value, but I’m not at all convinced there aren’t other UIs that would be more helpful.
Right, that’s what I mean by “synthesize examples from knowledge in the corpus”. I guess you could say it’s more like asking a question on Stack Overflow and then copying the code in the answer you get, but I actually like that framing less. I find “generative search” more illustrative.
I think AI coding tools are obviously a major innovation in that category because they use a much more sophisticated notion of “search” that can synthesize examples from knowledge contained in the corpus rather than only being able to return examples from the corpus. But it’s the same type of tool.
I think you’re correct, and I think the quoted post is making a category error. AI coding tools aren’t in quite the same category as PL innovations. They’re in the same category as “copying code off Stack Overflow”. This is not really a disparagement; that category is obviously extremely useful.
honestly I have no idea what joke you’re making here but I’m scared
didn’t I fire you from your position as my pr manager like four years ago
lol okay dude