It's pretty elegant.
for:
Y->CellRow:Cells
X->Cell:CellRow
AdjacentX:=X-1..X+1
AdjacentY:=Y-1..Y+1
AdjacentCell := Cells[AdjacentY][AdjacentX]
Cell<>AdjacentCell
AdjacentCell.Mined?
do:
set Cell.AdjacentMines += 1It's pretty elegant.
for:
Y->CellRow:Cells
X->Cell:CellRow
AdjacentX:=X-1..X+1
AdjacentY:=Y-1..Y+1
AdjacentCell := Cells[AdjacentY][AdjacentX]
Cell<>AdjacentCell
AdjacentCell.Mined?
do:
set Cell.AdjacentMines += 1So mcbrit's quick snippet to the rescue! :D
eta: I do wish programming language pages would all just put a small code sample right there on their landing page, at least as a supplement to whatever else they want to say. Mostly it's going to be experienced developers who look, and we don't want/need a lot of fluff; we're reasonably likely to fairly quickly grok most of what's interesting about a language from a well-crafted example, and that's more likely than anything else to prompt us to dig deeper if it tickles something inside us.
Seconded. As someone who doesn't work with Fortnite/UE5 development I suspect this page isn't really meant for me. But I would at least have assumed they'd want to have a few little standalone examples front-and-centre to entice any potential users
Also make sure your learnxiny page is up to date and appealing.
GDScript (godot) has one: https://learnxinyminutes.com/docs/gdscript/
Offtopic examples:
Nim: https://learnxinyminutes.com/docs/nim/
Crystal: https://learnxinyminutes.com/docs/crystal/
After reading those, how can you say no to nim or crystal?
I didn't even understand the Verse sample, I'd need to see the equivalent c++ (or other common language) to really get what made it appealing. Maybe also more explanation on why. A good learnxiny page might have done that for me.
I said failable above, but they might be some other kind of functions. They have a total effect type (functions that are guaranteed to terminate), which could be safely called by the type checker.
They don’t have as much familiarity with camelCase or snake_case as us programmers do.
CapitalCase is friendlier to a wider audience.
Only if the variable is a proper noun... otherwise it's pointlessly contrarian.
The C++ Concepts work with the same idea except it is at compile-time and applies to the whole function or a type/class.