Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1412151 Posts in 69752 Topics- by 58685 Members - Latest Member: gyanisingh

January 18, 2025, 03:28:27 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogs5N²+6N-4 . . . . . . (codename)
Pages: 1 ... 13 14 [15]
Print
Author Topic: 5N²+6N-4 . . . . . . (codename)  (Read 84089 times)
a-k-
Level 3
***


View Profile
« Reply #280 on: October 26, 2024, 01:19:51 AM »

155K player solutions, and people keep contributing new cost-cycles thresholds and pushing the limits... (like, a 1/54/254/254/254/254/25 dice??)

Level Stats

- Optional square-root "scale" for player histograms, and percentile and frequency in tooltips:

(top 23% and bottom 85%, presented in a mathematically-questionable format)

- When a solution is hovered, its metrics are overlaid on all histograms and cost/cycle graphs
- Extra info for hyper-optimal cost-cycles thresholds in tooltip

Sandbox

- Support for specifying permitted commands/workers and optional inputs. Sandbox solutions can now use Root.
- UI for inserting individual/remaining code examples:

- Other enhancements

Upgrade script

Context: Windows/Linux versions are distributed in a zip/tar.gz file (no installers, no auto-update)
- The distribution now includes a dependencies-free Python script that downloads the latest version, verifies its integrity and extracts it, keeping both old and new versions in separate directories. A file in the old directory points to the new one, so that if the player happens to run the old version, the game asks them if they want to run the new one instead.

Solution metrics tooltip

- The tooltip with all metrics (previously shown only in Level Stats) is now displayed also in the editor (below) and in View Solution.

(tooltip active areas; solutions redacted)

Solutions upgrade screen

- Progress indicators, and ability to view and skip verification of a solution:

(the latest trolling level)

Miscellaneous

- The tutorial now hints (subtly) that commands can be placed with spaces in between.
- Many UI enhancements: Replace UI revision (aligned with Find), more keyboard shortcuts (of course), more tables are sortable, View Solution available everywhere, and more
Logged

a-k-
Level 3
***


View Profile
« Reply #281 on: November 02, 2024, 08:42:22 AM »

Having fun with layout...



======== Update ========

Adding OR gates:


Changing to multi-input ORs:

« Last Edit: November 09, 2024, 12:30:06 AM by a-k- » Logged

a-k-
Level 3
***


View Profile
« Reply #282 on: November 09, 2024, 03:17:12 AM »

With the addition of circuit diagrams, the captcha game now has 9 levels, 3 languages in each one.



The guideline here was that players wouldn't need to consider individual bits but only numbers as a whole (provided that they're familiar with two's complement).
Logged

a-k-
Level 3
***


View Profile
« Reply #283 on: November 23, 2024, 01:41:07 PM »

The sandbox deserved its own context menu, with some line-oriented commands:

Logged

a-k-
Level 3
***


View Profile
« Reply #284 on: December 14, 2024, 03:31:53 AM »

New level:



Partial support for formulas in the sandbox:


(some undocumented limitations apply)
Logged

a-k-
Level 3
***


View Profile
« Reply #285 on: December 22, 2024, 01:32:12 PM »

This can make debugging nondeterministic scenarios so much easier that I can't believe it took me so long to come up with: a button that replays the last RNG-affected command, cycling through its various options in order.



(Previously, I would use Set Next Command to replay the same commands over and over until the desired scenario occurred. And that wouldn't even work for those inputs that employed xkcd-style RNGs, so I often had to switch input in the middle of debugging...)
Logged

a-k-
Level 3
***


View Profile
« Reply #286 on: January 04, 2025, 07:25:41 AM »

Dumping my initial thoughts about adding a new language to the captcha game (will probably edit this post once I start implementation and they meet reality):

1. Imperative style or functional style?

It's a high-level language that supports lambda expressions and other goodies, but it's much closer to C than to Scheme.
Imperative.

1.1. Unlimited jumps or "structured" jumps?

The language doesn't have "goto" statements at all.
This implies that we'll transpile Go.

2. Source language

The generated Go code may have:
  • "if", "else", and "else if"
  • "for" (conditional and unconditional)
  • "break" and "continue" (including multi-level jumps to labeled loops)
  • "return"
  • "goto" (forward, structured jumps only)

3. Eliminating "goto"

As said above, the language doesn't support "goto" statements, so they'll be replaced with blocks (like in Nim) and "break" statements.
You can think of a block as a loop with exactly one iteration, whose only reason for existence is to allow to exit it prematurely (i.e. jump to the block's end).
It's essentially like "for { ...body...; break; }" in Go.

4. Eliminating "return"

The semantics of "return" in the language is quite unusual and of little use to us. We'll treat "return" as a forward-jump to the end of the code, and accordingly replace it with a "break" statement inside a block spanning the entire function's body.

5. Eliminating "continue"

The language doesn't support "continue" either, so similarly, such statements will get replaced with blocks and "break" statements.
This time, each block will be nested inside the loop so that "break" jumps to its end, starting the next iteration.

6. How to write conditions and loops?

This is the second stylistic choice.
The language supports conditions and loops in its standard library, but exclusively using it will not demonstrate the language's unique features.

6.1. Loops

We'll implement loops by using recursion. The language doesn't support tail-code optimization, but that's the only way to iterate, and how the standard library implements loops under the hood.

6.2. Conditions

I think that we'll use the standard library for conditions, at least for start.

That will make for simpler hints to players in the game.
And will greatly simplify the implementation, making it very similar to what I did for Rust/Zig/Nim and many other languages.

6.2.1. Eliminating "else if"

The standard library doesn't support "else if", so we'll replace it with "else" and a nested "if" statement.

7. Conditional-->unconditional loops

We'll replace "for <cond> { ...body... }" with "for { if !<cond> { break; } ...body... }", so that all loops become unconditional (syntactically).
This will allow us to treat all loops in a uniform way, regardless of whether they test the condition in the beginning of the body (while loop), the middle, or the end (do-while loop).

8. Resulting syntax

  • "block { ... }", which can be exited using "break"
  • "if" and "else"
  • "for" (unconditional only)
  • "break" (including multi-level breaks)

9. Using recursion for loops

A loop with an "if <cond> { break; }" statement at the top level of its body (i.e. not nested inside anything, including blocks), where that statement is the only "break" statement the exits the loop, will perform the recursive call only if the condition is false.

For example, "for { ...body1...; if <cond> { break; } ...body2... }"
will get translated to "func f() { ...body1...; if !<cond> { ...body2...; f(); } }"

All other loops will perform the recursive call after their body, and be wrapped inside a block:
"block { func f() { ...body...; f(); } }"

This way, from now on, "break" statements only break blocks, not loops.
In fact, we don't have loops anymore, just functions and recursive calls.

(to be continued? little here is specific to the target language...)
Logged

bayersglassey
Level 1
*



View Profile
« Reply #287 on: January 04, 2025, 12:21:23 PM »

My 9-year-old son says "one of the best games I've ever played" Smiley
I've been teaching him about data structures and programming, and this is a great thing to play together...

Thank you! Smiley
Logged
a-k-
Level 3
***


View Profile
« Reply #288 on: January 06, 2025, 11:45:15 AM »

My 9-year-old son says "one of the best games I've ever played" Smiley
I've been teaching him about data structures and programming, and this is a great thing to play together...

Thank you! Smiley

Oh, that's a huge heartwarming compliment, thank you! I bet your excitement is a big part of his interest!
Logged

Pages: 1 ... 13 14 [15]
Print
Jump to:  

Theme orange-lt created by panic