news.volyx.in

Bad Apple but it's 6,500 regexes that I search for in Vim (eieio.games)

598 points by vortex_ape · 570 days ago · 61 comments on HN

Article summary

The article describes a project where the author created a version of the music video 'Bad Apple' using 6,500 regexes in Vim. The author used a combination of Python and Vim scripting to achieve this, first converting the video into a series of PNG images and then into a 2D array of 0s and 1s. The author then used Vim's search functionality to draw the images on the screen. The project was completed in a single day, with some optimizations added later to improve performance.

Main themes

  • Vim scripting
  • Regexes
  • Video rendering
  • Optimization techniques
  • Creative coding

What commenters say

  • The project is an impressive example of creative coding and showcases the author's skills in Vim scripting and regexes.
  • The use of multiple naive algorithms to generate search patterns was an effective way to improve performance, as it allowed the author to avoid getting bogged down in trying to find a single optimal solution.
  • The minimum cover problem, which allows for overlapping rectangles, is actually harder to solve optimally than the minimum partition problem, which does not allow overlap.
  • Some commenters appreciated the author's willingness to share their process and code, and noted that the project was a great example of how to make a prototype performant enough without needing to create a perfect solution.
  • Others discussed the technical details of the project, including the use of Vim macros and the limitations of the NES hardware used in a related project.
  • The project has inspired some commenters to try similar creative coding projects, such as running 'Bad Apple' on unusual hardware or creating interactive text art.
  • There are different opinions on the complexity of the minimum cover problem and the minimum partition problem, with some arguing that the former is easier to solve and others arguing that it is harder.