New Exercise Proposal: Prism

Tracks can always opt to not implement a test.

The tests data should just have the expected prisms. So long as the test inputs are set up such that lasers are near the prisms (ie there are no “close” cases), the test data doesn’t need to do anything else. The test for “close to prism” would be in the solutions, not the tests.

I just finished creating a little python code to view the test solutions.
I haven’t created any tests with floating yet.
If anyone wants to have fun creating something bizarre to put in the tests, they are welcome to do so.
As soon as I have time, I’ll create the PR too.

1 Like

This looks good to me! I would suggest tweaking test names a bit and reordering the prisms so the results have more randomness to the order.

2 Likes

PR has been merged. The exercise is currently live on CoffeeScript.

5 Likes

Thank you all, as always.

I will check the implementations in the various tracks from time to time.
Be careful, I’m watching you! :joy:

3 Likes
1 Like
2 Likes
1 Like

I’m wondering if a visual aid like below might help visualize the path from the instructions.

     Y
  10 |        [#1]---------------→[#3]↗
   5 │         ↑        
   0 │-------→[#2]      [#4]
  -5 │
 -10 └─────────────────────────────────── X
     0    5    10   15   20   25   30   35
1 Like

I notice the exercise blurb is

“Calculate the path of a laser through reflective prisms.”

Should it be

“Calculate the path of a laser through refractive prisms.”

?

1 Like

Yes. It ought to be refractive.

I think you reflect the light back to you, but you refract the light towards something else. So yeah, refractive prism makes more sense. The OP mentioned angles of refraction as well.

Are there any more upvotes for the visual aid suggestion ?

If I’m doing a PR I would like to do both.

2 Likes

Yeah, go ahead and do both. Feel free to do whatever makes sense for the visual aid though. That graph was just a first draft.

+1 from me.

I got AI to draw me a picture

However, where should it be stored so it can be shared amongst tracks?

Can we release AI content under our MIT license?

We use SVG images in other exercises. See this comment for details.

Google Gemini tells me this:


The question of licensing for AI-generated images is a bit unique compared to traditional stock photos or art. Here is how it breaks down for the images and graphs I created for you:

1. Ownership and Use

According to Google’s Terms of Service, Google does not claim ownership of the content you generate with Gemini.

  • You own the output: You are free to use, share, or publish the images I’ve generated for you.
  • No License Fees: There are no royalties or licensing fees required to use these images.

2. Copyright Status

While you own the output, the legal status of AI-generated content is currently in a “public domain” like state in many jurisdictions (including the US):

  • No Human Authorship: The US Copyright Office has consistently ruled that images generated solely by AI without significant human “expressive control” cannot be copyrighted.
  • What this means for you: While you can use the image however you like, you may not be able to stop others from using it if they find it, because it lacks the legal protection of a standard copyright.

3. The Matplotlib Graph

The specific graph I generated using the code tool (Matplotlib) is slightly different. Since it was created using a standard programming library to plot precise coordinates:

  • It is essentially a technical diagram.
  • Mathematical plots and data visualizations are generally considered “functional” or “factual” and typically do not qualify for copyright protection anyway, regardless of whether a human or an AI wrote the code to generate them.

4. Restrictions

The only real “license” restriction is that you must follow Google’s Prohibited Use Policy. This mainly means you can’t use the images to:

  • Generate “deepfakes” or misleading content.
  • Infringe on existing trademarks (like using a famous logo in the grid).
  • Violate safety or harassment policies.

In short: You are free to use the graph for your project without paying anyone or asking for further permission.