Λογότυπο Finding The Longest Domino Chain

Finding The Longest Domino Chain

Οργανισμός
runtime-si
finding-the-longest-domino-chain

Finds the longest chain of matching dominoes a hand can lay from a start value - the Mexican Train move of building your own train from the engine double or your train's open end, or a solitaire end-to-end line - and lays it out on the table. Tiles are edges between pip values; every chain is walked depth first (as RGBz/mexican-train-domino-solver does) with an exact bound that cuts branches which cannot win, ranked longest, then most pips, then not ending on a double (a double left open must be covered). Returns the chain with each tile turned so its matching half comes first, the leftover tiles, the open value at the end and, from the train end's world point and direction, every tile's place pose and end points - straight on, round a corner before the table edge or a placed tile, doubles crosswise. No motion. Use on a Mexican Train turn or to plan a matching-ends line for the arm to build, after reading the tiles' values.

Επισκόπηση

Εκδότηςruntime-si
ΑποθετήριοRoboSkillHub
Όνομα δεξιότηταςfinding-the-longest-domino-chain
Αστέρια
242
Διακλαδώσεις
27
Συνοδευτικά αρχεία
3
Άδεια χρήσηςMIT
Σύνδεσμοι
  • Οδηγίες σε Markdown

    Ένα αρχείο SKILL.md που το μοντέλο φορτώνει όταν χρειάζεται, ώστε να καταναλώνει token μόνο όταν ένα αίτημα είναι πράγματι σχετικό.

  • Λειτουργεί με οποιοδήποτε LLM

    Οι δεξιότητες AI είναι απλό Markdown, όχι κώδικας για συγκεκριμένο πάροχο, επομένως αυτή η δεξιότητα λειτουργεί με GPT, Claude, Gemini, Grok ή ένα τοπικό μοντέλο.

  • Συνοδευτικά αρχεία: 3

    Αρχεία script, πρότυπα και υλικό αναφοράς που μπορεί να διαβάζει το μοντέλο καθώς εργάζεται. Τα αρχεία είναι μόνο για ανάγνωση και δεν εκτελούνται ποτέ.

  • Ανοιχτού κώδικα

    Δημοσιεύτηκε στο GitHub από τον λογαριασμό runtime-si. Ελέγξτε τα αρχεία της δεξιότητας στο αποθετήριο πριν την εγκαταστήσετε.

Εγκατάσταση

Εγκαταστήστε τη δεξιότητα AI Finding The Longest Domino Chain στο TypingMind για να τη χρησιμοποιείτε με οποιοδήποτε LLM ή προσθέστε τη σε άλλον πράκτορα AI που διαβάζει αρχεία SKILL.md.

1

Εγκατάσταση στο TypingMind

Το TypingMind εγκαθιστά μια δεξιότητα απευθείας από τον φάκελό της στο GitHub — διαβάζει το SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία σε πακέτο και αποθηκεύει το αποτέλεσμα τοπικά.

  1. Ανοίξτε την εφαρμογή και μεταβείτε στα Πρόσθετα → Δεξιότητες.
  2. Επιλέξτε «Εγκατάσταση από GitHub».
  3. Επικολλήστε το παρακάτω URL του φακέλου της δεξιότητας και επιβεβαιώστε.
    https://github.com/runtime-si/RoboSkillHub/tree/main/skills/finding-the-longest-domino-chain
  4. Ενεργοποιήστε τη δεξιότητα σε κάθε συνομιλία όπου θέλετε να είναι διαθέσιμη.
Πρόσθετα → Δεξιότητες → Προσθήκη δεξιότητας → Από URL του GitHub, έπειτα επικολλήστε το URL του φακέλου και πατήστε «Συνέχεια».
2

Εγκατάσταση σε άλλον πράκτορα AI

Κάθε πράκτορας AI που υποστηρίζει τη μορφή Agent Skills μπορεί να χρησιμοποιήσει αυτή τη δεξιότητα — αντιγράψτε τον φάκελο στον κατάλογο δεξιοτήτων του.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/runtime-si/RoboSkillHub.git /tmp/RoboSkillHub
mkdir -p .claude/skills
cp -r /tmp/RoboSkillHub/skills/finding-the-longest-domino-chain .claude/skills/finding-the-longest-domino-chain
Επανεκκινήστε το Claude Code μετά την αντιγραφή, ώστε να εντοπίσει τη νέα δεξιότητα.

Χρησιμοποιήστε τη στο TypingMind

Ενεργοποιήστε τη δεξιότητα Finding The Longest Domino Chain σε οποιαδήποτε συνομιλία στο TypingMind και το μοντέλο αναλαμβάνει τα υπόλοιπα. Το όνομα και η περιγραφή της περιλαμβάνονται στην προτροπή συστήματος και, μόλις προκύψει ένα σχετικό αίτημα, το μοντέλο φορτώνει μόνο του τις πλήρεις οδηγίες — δεν χρειάζεται ποτέ να την καλείτε χειροκίνητα και δεν καταναλώνει token μέχρι να χρησιμοποιηθεί πραγματικά.

Το μοντέλο φορτώνει αυτόματα τη δεξιότητα Finding The Longest Domino Chain μόλις λάβει ένα σχετικό αίτημα.

Λειτουργεί με οποιοδήποτε μοντέλο AI

Οι δεξιότητες AI είναι οδηγίες σε απλό κείμενο Markdown και όχι κώδικας για συγκεκριμένο πάροχο, οπότε η δεξιότητα Finding The Longest Domino Chain δεν περιορίζεται στο μοντέλο για το οποίο γράφτηκε. Εγκαταστήστε τη μία φορά στο TypingMind και χρησιμοποιήστε τη με GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ή ένα τοπικό μοντέλο που εκτελείτε εσείς — πάντα με τα δικά σας κλειδιά API.

  • Φόρτωση μόνο όταν χρειάζεται

    Η προτροπή συστήματος περιλαμβάνει μόνο το όνομα και την περιγραφή. Οι οδηγίες ανακτώνται με το πρώτο σχετικό αίτημα, οπότε μια δεξιότητα που δεν χρησιμοποιείται δεν έχει κόστος.

  • Αλλάξτε μοντέλο κατά τη διάρκεια της συνομιλίας

    Επειδή η δεξιότητα αποτελείται από οδηγίες και όχι από κώδικα, η αλλαγή μοντέλου δεν επηρεάζει τη λειτουργία της — το επόμενο μοντέλο διαβάζει το ίδιο αρχείο SKILL.md.

Οδηγίες δεξιότητας

Αυτό είναι το περιεχόμενο του αρχείου SKILL.md που φορτώνει το μοντέλο. Διαβάστε το πριν από την εγκατάσταση — μια δεξιότητα αποτελείται από οδηγίες που θα ακολουθήσει το μοντέλο σας.

finding-the-longest-domino-chain

The planning half of a Mexican Train turn (or of a solitaire "use as many tiles as you can" line): which of my tiles, in which order, turned which way, and where each one goes on the table.

The loop

  1. reading-domino-pips-and-orientation on the hand: each tile's value_ab. On the board: the engine (or your train's last tile) - its open value, the midpoint of its open edge and the outward direction, as start_end.
  2. This skill. chain_found: place chain[k] for k = 0, 1, ...: pick the hand tile hand_index, put it at place_pose with its a end at target_ends_world[0]. new_end and footprints_after are the board after the chain.
  3. In Mexican Train the leftover tiles go on the other trains; choosing-a-domino-move-by-end-matching chooses single plays on two open ends.

What it does

  1. Graph (Graph.ts): pip values are the nodes, tiles the edges (a double is a loop). A chain is a trail from the start value: each tile once, each tile holding the value the previous one left open (Domino.getOtherSide).
  2. Search (Graph.findMostValuableChain): depth first over every chain from the start value; with no start value every value in the hand is tried.
  3. Ranking (compareChains): the longer chain; on equal length the one with more pips; then the one that does not end on a double (an open double must be covered in Mexican Train). objective: most_pips puts pips before length (to shed points late in a round).
  4. Bound (new, exact): at each node the unused tiles in the open value's connected component, less one non-double for every pair of odd-degree values beyond the chain's two ends (a chain is an Euler trail of the tiles it uses; an even start leaves one more pair), bound the length and the pips a chain can still reach; a branch that cannot strictly beat the best chain so far is cut. A full double-six set is proven one 28-tile chain in 121 nodes.
  5. Budget (new): after max_nodes (200 000) tiles tried the search stops and returns its best chain with exhaustive: false; length_bound is the root bound, so a chain that long is still proven longest.
  6. Placement (new; the geometry of choosing-a-domino-move-by-end-matching): from the train end at edge point P going out along d, tile L x W, gap g (1 mm): straight (centre P + d (g + L/2)), a double crosswise (centre P + d (g + W/2)), or round a corner (the matching half square in front of the end, the tile along d turned +-90 deg). Straight when it fits and the next tile could follow, else the corner with the longer straight run after it (toward the table centre on a tie). Inside the table box (table, else robot.describe_workspace bounds) less edge_margin (10 mm), overlapping no footprint by more than 0.5 mm. Since the whole chain is known, the layout is searched depth first in that order (the first leaf is the greedy layout) until every tile fits or layout_tries (20 000) placements were tried.

Inputs

  • hand: [[a, b], ...] or tile records with value_ab (or value).
  • start_value: the engine double's value or the train's open value; None lets the chain start anywhere (solitaire).
  • start_end: {value, position, direction, crosswise}; without a position the chain is returned without placement.
  • objective (longest), max_pip (12, double-twelve), max_nodes (200 000), doubles_crosswise (true), footprints (placed tiles: center, axis, optional length / width), table ({min, max}), tile_size ([L, W], 0.048 x 0.024 m), touch_gap (0.001 m), edge_margin (0.01 m), layout_tries (20 000).

The constants, and why

  • TILE_SIZE 48 x 24 mm, TOUCH_GAP 1 mm, EDGE_MARGIN 10 mm, OVERLAP_TOLERANCE 0.5 mm, RUN_LOOKAHEAD 4: as choosing-a-domino-move-by-end-matching (the reader's tile, touching without pushing, a few mm of placing error).
  • MAX_PIP 12: the source's Domino.from takes 0..12 (Mexican Train is played with a double-twelve set).
  • MAX_NODES 200 000: about 0.3 s in Python here; every random 15-tile double-twelve or double-nine hand finished far below it (see Measured).
  • LAYOUT_TRIES 20 000: no measured layout needed more than 31; the cap only bounds the time when no layout exists.

Measured

Fidelity to the source. The upstream TypeScript (commit ac758e8, compiled with tsc 4.9, run under node 24) and best_chain on the same random hands, half of them turned, start value random or none: the same (length, pips, ends-on-a-double) in 1440 / 1440 hands - 300 of 8 tiles (double-six), 300 of 10 (double-four), 300 of 12 and 300 of 15 (double-twelve), 200 of 15 (double-nine), 200 of 12 and 40 of 16 (double-six), every chain legal (starts at the start value, each tile once, ends matching). The unit tests also check the search against brute force over every ordered selection on 150 small hands.

Search size (default budget, start value random; tests/bundles/_domino_chain_eval.py):

sethandhandsexhaustivenodes median / maxms median / max
double-12152000200058 / 17250.1 / 3
double-915500500311 / 46110.5 / 7
double-61610010013 410 / 111 91519 / 160
double-6205012200 000 (budget)295 / 376
double-624203200 000 (budget)308 / 346
double-628 (full set)55121 / 1600.4

Where the budget stopped the search (dense 20-24 tile double-six hands), the chain's length equalled the root bound in 50 / 50 (20 tiles) and 19 / 20 (24 tiles) hands: the length is proven longest, only the pip tie-break is not. The upstream walk was 1.0-2.5x faster than the port on small hands (node vs CPython) and no faster on the 16-tile double-six hands (median 18.7 vs 17.5 ms); it has no budget, so dense hands run until every chain is walked.

Placement (same script; the real YAM station's tool box x -0.15..0.35, y 0.10..0.55 m from real/motion_server.py, less 10 mm; start ends at random points in it facing +-x or +-y). Every placement was checked: inside the box, no two footprints overlapping, the matching half toward the previous tile.

sethandstartswith a chainall placed (greedy alone)no first tile fitsstopped part-wayplacements tried median / maxms median / max
double-1215500450418 (418)32010 / 158 / 35
double-915300284263 (263)21012 / 1512 / 26
double-62810010095 (94)5028 / 3055 / 331

Every no_room was a start end facing the table edge with no room for even the first tile. The full double-six set from (-0.12, 0.32) along +x is the case the greedy layout (choosing-a-domino-move-by-end-matching's rule, one tile at a time) loses: it spirals into its own start at tile 27 of 28; backtracking lays all 28 after 31 placements.

Not done

  • No robot motion and no perception: the hand comes from reading-domino-pips-and-orientation and the tiles are placed by a placing skill (placing-with-contact-descent or transporting-objects); none was run in this loop. The sim check of PORTING.md does not apply (the skill does not move the arm).
  • Mexican Train rules beyond the chain are not modelled (the public train, covering a double someone else left open, drawing). A double inside the chain is placed crosswise and the chain goes on straight from its far side, as on a real table.
  • Among chains of the best rank the first found is kept; the search does not prefer one that fits the table, so a chain can route no_room while another equally long one would have fitted.

Provenance

Adapted from mexican-train-domino-solver (MIT, Anton C Beza Jr, commit ac758e8): src/Graph.ts (findMostValuableChain), src/findMostValuableChain.ts (compareChains), src/Domino.ts (getOtherSide). Changed: Python; an exact branch-and-bound and a node budget instead of walking every chain; the connected component split (Graph.generateAll) replaced by the bound; a pips-first objective; tiles turned so the matching half comes first; routed exits. New: the world layout (the geometry of choosing-a-domino-move-by-end-matching). The license is LICENSE.mexican-train-domino-solver beside this file.

Συνοδευτικά αρχεία

Το μοντέλο τα διαβάζει όποτε χρειάζεται, όσο η δεξιότητα είναι φορτωμένη. Διατίθενται ως αρχεία για ανάγνωση και δεν εκτελούνται ποτέ.

Συχνές ερωτήσεις

Τι κάνει η δεξιότητα AI Finding The Longest Domino Chain;

Finds the longest chain of matching dominoes a hand can lay from a start value - the Mexican Train move of building your own train from the engine double or your train's open end, or a solitaire end-to-end line - and lays it out on the table. Tiles are edges between pip values; every chain is walked depth first (as RGBz/mexican-train-domino-solver does) with an exact bound that cuts branches which cannot win, ranked longest, then most pips, then not ending on a double (a double left open must be covered). Returns the chain with each tile turned so its matching half comes first, the leftover...

Γιατί να χρησιμοποιήσετε τη δεξιότητα Finding The Longest Domino Chain στο TypingMind;

Επειδή την εγκαθιστάτε μία φορά και τη χρησιμοποιείτε με οποιοδήποτε μοντέλο. Η Finding The Longest Domino Chain είναι απλό Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως η ίδια δεξιότητα λειτουργεί με GPT-5, Claude, Gemini, Grok ή ένα τοπικό μοντέλο — και μπορείτε να αλλάξετε μοντέλο κατά τη διάρκεια της συνομιλίας χωρίς να διακοπεί η λειτουργία της. Το TypingMind λειτουργεί με τα δικά σας κλειδιά API, οπότε πληρώνετε απευθείας τους παρόχους αντί για συνδρομή ανά θέση χρήστη, ενώ οι δεξιότητες και οι συνομιλίες σας παραμένουν στον δικό σας χώρο αποθήκευσης.

Πώς εγκαθιστώ τη δεξιότητα Finding The Longest Domino Chain στο TypingMind;

Στο TypingMind, ανοίξτε Πρόσθετα → Δεξιότητες → Εγκατάσταση από το GitHub και επικολλήστε τη διεύθυνση https://github.com/runtime-si/RoboSkillHub/tree/main/skills/finding-the-longest-domino-chain. Το TypingMind διαβάζει το αρχείο SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία και εγκαθιστά τη δεξιότητα, την οποία μπορείτε να ενεργοποιείτε ανά συνομιλία.

Ποια μοντέλα AI μπορούν να χρησιμοποιήσουν τη δεξιότητα Finding The Longest Domino Chain;

Οποιοδήποτε μοντέλο συνδέετε στο TypingMind. Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως τα GPT, Claude, Gemini, Grok και τα τοπικά μοντέλα μπορούν όλα να φορτώσουν αυτή τη δεξιότητα όταν ένα αίτημα αντιστοιχεί σε αυτή.

Με πόσα μοντέλα AI μπορώ να χρησιμοποιήσω τη δεξιότητα Finding The Longest Domino Chain;

Με όσα θέλετε. Στο TypingMind μπορείτε να χρησιμοποιήσετε τη δεξιότητα Finding The Longest Domino Chain με οποιοδήποτε μοντέλο υποστηρίζει δεξιότητες, όπως τα GPT, Claude, Gemini, Grok, DeepSeek, Mistral και Llama, χρησιμοποιώντας τα δικά σας κλειδιά API.

Είναι δωρεάν η δεξιότητα AI Finding The Longest Domino Chain;

Ναι. Δημοσιεύεται στο GitHub από τον λογαριασμό runtime-si με την άδεια χρήσης MIT. Πληρώνετε μόνο τον δικό σας πάροχο AI για τα token που χρησιμοποιείτε.

Τι είναι οι δεξιότητες AI;

Μια δεξιότητα AI είναι ένα επαναχρησιμοποιήσιμο πακέτο οδηγιών που διδάσκει σε ένα μοντέλο AI πώς να εκτελεί μια συγκεκριμένη εργασία. Ακολουθεί την ανοιχτή μορφή Agent Skills: ένα αρχείο SKILL.md με όνομα και περιγραφή, μαζί με τυχόν σενάρια κώδικα, πρότυπα ή αρχεία αναφοράς που μπορεί να χρειαστεί το μοντέλο. Το μοντέλο διαβάζει τις οδηγίες μόνο όταν το αίτημά σας αντιστοιχεί στη δεξιότητα, οπότε μια εγκατεστημένη δεξιότητα δεν κοστίζει τίποτα μέχρι να χρησιμοποιηθεί.

Σε τι διαφέρουν οι δεξιότητες AI από τα πρόσθετα ή τους συνδέσμους MCP;

Ένα πρόσθετο ή ένας σύνδεσμος MCP παρέχει στο μοντέλο νέα εργαλεία που μπορεί να καλέσει — κώδικα που εκτελείται κάπου και επιστρέφει ένα αποτέλεσμα. Μια δεξιότητα AI παρέχει αντί γι’ αυτό γνώσεις και διαδικασίες στο μοντέλο: πώς να προσεγγίσει μια εργασία, ποια βήματα να ακολουθήσει και ποια χαρακτηριστικά έχει ένα καλό αποτέλεσμα. Οι δεξιότητες είναι απλό Markdown, επομένως δεν χρειάζονται διακομιστή, κλειδί API ή περιβάλλον εκτέλεσης και λειτουργούν με οποιοδήποτε μοντέλο.

Προβολή όλων

Δημιουργήστε τώρα τον δικό σας χώρο εργασίας AI

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇