Jump to content
IGNORED

Is this a triangle? (simple programming challenge)


Arnauld

Recommended Posts

Every once in a while, I post an answer in CP1610 assembly on codegolf.stackexchange.com. I'm usually doing that for trivial challenges that would be boring to solve in some higher level language.

 

The following challenge was recently posted (slightly rephrased):

 

Given three positive integers (a, b, c), write a program or function that determines whether any triangle could have (a, b, c) for side lengths.

 

I thought that you guys might be interested in giving it a try.

 

My solution (spoiler) is a 12-DECLE routine taking the integers in R0, R1, R2 and setting or clearing the carry. To be honest, I didn't spend a lot of time on it so it's quite likely that a shorter solution exists.

 

You can follow this link to see more of my Intellivision answers on Code Golf if you're curious.

 

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...