TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: 100 Depth tree search on your iPhone with Rust

3 点作者 cheepin4 个月前
I made this app with Rust + React Native. It combines a puzzle game with a solver. While quite a lot of work went into UX, the solver is what I’m most proud of and was the first functional piece of the app. Originally, it solved one layer at a time, but when I added the undo feature I decided to try to go deeper and try to answer “What if the solver has perfect knowledge of the RNG?”. Going from computer CPU to phone and from search depth of 36 to 108 was obviously not going to get good brute force coverage considering I could only explore 30ish moves in a reasonable time which is a small percentage of all paths even before tripling the length of a solution. It ended up being a rabbit hole that led to what might be a novel search strategy that finds higher scores despite eliminating most of the pruning that made the single layer so fast.<p>Rust was chosen because I like it and already had success using it for game solving. I also had written another iOS app using Rust for the business logic. React Native as the UI was something I wanted to evaluate after their ability to interface with Rust code vastly improved last year with the release of uniffi-bindgen-react-native. The only reason it isn’t also available for Android is procrastination.<p>The rules of the puzzle come from an old Java game, which means that by reading the decompiled source and porting the RNG from Java, the app is a pretty faithful reproduction. In fact, if you sniff the seed from the game’s network traffic or dump it from the game’s memory, you can replay the same game.

1 comment

upmind4 个月前
Basic Question but how exactly does Rust run on iPhones, does it get compiled into another language?