Not

Hacker News!

Beta
Home
Jobs
Q&A
Startups
Trends
Users
Live
AI companion for Hacker News

Not

Hacker News!

Beta
Home
Jobs
Q&A
Startups
Trends
Users
Live
AI companion for Hacker News
  1. Home
  2. /Story
  3. /Solving Fizz Buzz with Cosines
  1. Home
  2. /Story
  3. /Solving Fizz Buzz with Cosines
Nov 21, 2025 at 12:28 PM EST

Solving Fizz Buzz with Cosines

hprotagonist
188 points
60 comments

Mood

informative

Sentiment

neutral

Category

tech_discussion

Key topics

Programming

Mathematics

Algorithms

Discussion Activity

Light discussion

First comment

2d

Peak period

1

Day 3

Avg / period

1

Comment distribution1 data points
Loading chart...

Based on 1 loaded comments

Key moments

  1. 01Story posted

    Nov 21, 2025 at 12:28 PM EST

    2d ago

    Step 01
  2. 02First comment

    Nov 23, 2025 at 9:56 PM EST

    2d after posting

    Step 02
  3. 03Peak activity

    1 comments in Day 3

    Hottest window of the conversation

    Step 03
  4. 04Latest activity

    Nov 23, 2025 at 9:56 PM EST

    4h ago

    Step 04

Generating AI Summary...

Analyzing up to 500 comments to identify key contributors and discussion patterns

Discussion (60 comments)
Showing 1 comments of 60
vincenthwt
4h ago
Background Context: I am a machine vision engineer working with the Halcon vision library and HDevelop to write Halcon code. Below is an example of a program I wrote using Halcon:

* Generate a tuple from 1 to 1000 and name it 'Sequence' tuple_gen_sequence (1, 1000, 1, Sequence)

* Replace elements in 'Sequence' divisible by 3 with 'Fizz', storing the result in 'SequenceModThree' tuple_mod (Sequence, 3, Mod) tuple_find (Mod, 0, Indices) tuple_replace (Sequence, Indices, 'Fizz', SequenceModThree)

* Replace elements in 'Sequence' divisible by 5 with 'Buzz', storing the result in 'SequenceModFive' tuple_mod (Sequence, 5, Mod) tuple_find (Mod, 0, Indices) tuple_replace (SequenceModThree, Indices, 'Buzz', SequenceModFive)

* Replace elements in 'Sequence' divisible by 15 with 'FizzBuzz', storing the final result in 'SequenceFinal' tuple_mod (Sequence, 15, Mod) tuple_find (Mod, 0, Indices) tuple_replace (SequenceModFive, Indices, 'FizzBuzz', SequenceFinal)

Alternatively, this process can be written more compactly using inline operators:

tuple_gen_sequence (1, 1000, 1, Sequence) tempThree := replace(Sequence, find(Sequence % 3, 0), 'Fizz') tempFive := replace(tempThree, find(Sequence % 5, 0), 'Buzz') FinalSequence := replace(tempFive, find(Sequence % 15, 0), 'FizzBuzz')

In this program, I applied a vectorization approach, which is an efficient technique for processing large datasets. Instead of iterating through each element individually in a loop (a comparatively slower process), I applied operations directly to the entire data sequence in one step. This method takes advantage of Halcon's optimized, low-level implementations to significantly improve performance and streamline computations.

59 more comments available on Hacker News

View full discussion on Hacker News
ID: 46006598Type: storyLast synced: 11/23/2025, 12:07:04 AM

Want the full context?

Jump to the original sources

Read the primary article or dive into the live Hacker News thread when you're ready.

Read ArticleView on HN

Not

Hacker News!

AI-observed conversations & context

Daily AI-observed summaries, trends, and audience signals pulled from Hacker News so you can see the conversation before it hits your feed.

LiveBeta

Explore

  • Home
  • Jobs radar
  • Tech pulse
  • Startups
  • Trends

Resources

  • Visit Hacker News
  • HN API
  • Modal cronjobs
  • Meta Llama

Briefings

Inbox recaps on the loudest debates & under-the-radar launches.

Connect

© 2025 Not Hacker News! — independent Hacker News companion.

Not affiliated with Hacker News or Y Combinator. We simply enrich the public API with analytics.