<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Roman - A Little Coding Challenge in BreakPoint</title>
    <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2524070#M23552</link>
    <description>&lt;P&gt;Just spent a few more minutes on this and found some simplifications. See if you can find them. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Aug 2013 04:36:56 GMT</pubDate>
    <dc:creator>altenbach</dc:creator>
    <dc:date>2013-08-14T04:36:56Z</dc:date>
    <item>
      <title>Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2523536#M23545</link>
      <description>&lt;P&gt;I had a chance to participate in a coding challenge and came out pretty well. However, I know the brain power in BreakPoint is far superior and I wanted to put my code to the test. The original problem is:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;EM&gt;&lt;BR /&gt;Write a program to convert to (and from) roman numerals. So your program should be able to take the input of 27 and return XXVII, and take MCMLXXXI and return 1981. And of course any other values. The program must work for all numbers between the upper bound of 4000 and the lower bound of 0 (both non-inclusive). &lt;BR /&gt;&lt;/EM&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I wanted to test this by having it generate the list of 1-3999 and then convert all the numbers into Roman, then back into Arabic. I doubt I wrote it the fastest, and I doubt there's not a rube in there. So, if any of you want to take a crack at it and see if you can make the code simplier and faster. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my solution (don't peak until you tried it)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruce&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2013 19:00:46 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2523536#M23545</guid>
      <dc:creator>bsvare</dc:creator>
      <dc:date>2013-08-13T19:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2523608#M23546</link>
      <description>&lt;P&gt;Well, that's a job for LookupTableMan, of course. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(the reverse is a bit slow due to the linear search, so we should use &lt;EM&gt;variant attributes&lt;/EM&gt; instead (not shown)).&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2013 19:32:29 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2523608#M23546</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2013-08-13T19:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2523626#M23547</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;altenbach wrote:
&lt;P&gt;(the reverse is a bit slow due to the linear search, so we should use &lt;EM&gt;variant attributes&lt;/EM&gt; instead (not shown)).&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;With variant attributes, it is about twice as fast as yours (but a bit cryptic, codewise). &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2013 19:40:56 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2523626#M23547</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2013-08-13T19:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2523686#M23548</link>
      <description>&lt;P&gt;Here is an explicit decimal -&amp;gt; roman conversion. Seems about 25% faster than yours. More importantly, it is easier to read (only two cases!) and works directly off the numeric input.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2013 20:25:49 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2523686#M23548</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2013-08-13T20:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2523772#M23550</link>
      <description>&lt;P&gt;OK, here's my full code alternative for "Number to Roman String" and "Roman String to Number". Note that it is more universal and works fine for inputs &amp;gt;3999 (while yours fails for e.g. 4000).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is about almost twice as fast on my PC (3.5ms vs. 6.5ms). I am sure it could be tweaked further. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Each conversion could be turned into a proper subVI for universal re-use. Of course it would need input checking and all the other expected stuff. :D)&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2013 21:33:09 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2523772#M23550</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2013-08-13T21:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2524070#M23552</link>
      <description>&lt;P&gt;Just spent a few more minutes on this and found some simplifications. See if you can find them. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2013 04:36:56 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2524070#M23552</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2013-08-14T04:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2524094#M23553</link>
      <description>&lt;P&gt;I would, but version 8.6 can't open 2012 files and I lack the space (and computing power) to install an updated version at present.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an aside, &lt;A href="http://en.wikipedia.org/wiki/Roman_numerals#Large_numbers" target="_blank"&gt;http://en.wikipedia.org/wiki/Roman_numerals#Large_numbers&lt;/A&gt; is interesting.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2013 05:09:37 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2524094#M23553</guid>
      <dc:creator>Hornless.Rhino</dc:creator>
      <dc:date>2013-08-14T05:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2527962#M23571</link>
      <description>&lt;P&gt;My attempt at Roman to Arabic numerals. Arabic to roman is alot simpler. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; As the romans has no strict rules, the same number can be written in several ways, something you avoid with a arabic to roman generator. E.g. 9 can be ix, viiii or viv. My program actually translates them all. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I haven't checked performance, but it should be fast enough.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/Y&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2013 13:24:30 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2527962#M23571</guid>
      <dc:creator>Yamaeda</dc:creator>
      <dc:date>2013-08-18T13:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2530524#M23577</link>
      <description>&lt;P&gt;I don't really have anything to contribute. &amp;nbsp;I just don't want the fact that Altenbach posted 5 times in a row to, go un-noticed. &amp;nbsp;Maybe that's how he got his 20K+ medal. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(know that I mean no disrespect and this is intended to be a joke, this is BreakPoint after all)&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2013 17:22:24 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2530524#M23577</guid>
      <dc:creator>Hooovahh</dc:creator>
      <dc:date>2013-08-20T17:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2530578#M23578</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.ni.com/t5/user/viewprofilepage/user-id/74523"&gt;@Hooovahh&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I just don't want the fact that Altenbach posted 5 times in a row to, go un-noticed. &amp;nbsp;Maybe that's how he got his 20K+ medal. &amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;My posts are far apart in time. It is not my fault if the rest of the community fails to contribute &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2013 18:03:20 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2530578#M23578</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2013-08-20T18:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2531016#M23581</link>
      <description>&lt;P&gt;I got almost this far and gave up until tonight. &amp;nbsp;Now I give up!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.ni.com/t5/image/serverpage/image-id/118598iE6F5BEF49A2DAB68/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="RomanFun_BD.png" title="RomanFun_BD.png" align="center" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2013 22:41:03 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2531016#M23581</guid>
      <dc:creator>jcarmody</dc:creator>
      <dc:date>2013-08-20T22:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2542771#M23636</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;It's a really nice code jcarmody,&lt;/P&gt;
&lt;P&gt;Can you please post a VI snippet of this code, or join the .vi on a post ?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;S. Michaud&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2013 12:57:41 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2542771#M23636</guid>
      <dc:creator>PragmaTest</dc:creator>
      <dc:date>2013-09-01T12:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Roman - A Little Coding Challenge</title>
      <link>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2542805#M23639</link>
      <description>&lt;P&gt;I thought I make two standard tools in the style of the VIs in the &lt;A href="http://zone.ni.com/reference/en-XX/help/371361K-01/glang/string_numb_conver_func/" target="_self"&gt;String/Number Conversion Palette&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;Number to Roman String&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;Roman String to Number&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I Implemented very crude error handling:&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;"Number to Roman String" returns empty string for illegal inputs.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;"Roman String to Number" returns -1 for illegal inputs.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;Number is I32 representation only (the algorithm needs to be modified if it should work with e.g. U32).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VIs are in LabVIEW 2011. Enjoy and modify as needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.ni.com/ni/attachments/ni/BreakPoint/23639/1/RomanTester.png" border="0" alt="" title="" align="center" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2013 21:08:06 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Roman-A-Little-Coding-Challenge/m-p/2542805#M23639</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2013-09-02T21:08:06Z</dc:date>
    </item>
  </channel>
</rss>

