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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

The Skyline Problem in Racket

5 点作者 soegaard11 个月前

1 comment

SillyUsername11 个月前
Ok maybe I&#x27;m an idiot but wouldn&#x27;t the simplest algorithm be<p>1) Choose highest building. Draw it&#x27;s roof horizontal only.<p>2) Repeat 1) choosing building by next height lower, unless lower building roof within range of an existing rendered roof x+width, then exclude that building from rendering.<p>3) Once all buildings roofs drawn, draw the building side verticals downwards from each until they hit a roof or ground (either from a cache or detecting pixel colour), in which case stop.
评论 #40737459 未加载