GoogleIt Mail IT Print IT PermaLinkProgramming Challenges (via Vowe)
09:23:58 PM

Volker asked who could do this in COBOL. While I'm sure that's do-able, I'm mercifully without access to any COBOL compiler at present time, therefore I give you a Lotus Notes @formula language solution:

rem "There's probably an easier way"; x:=4:1:2:6:2:1:3:1:3:1:6:1:1:1:2:3:1:1:1:3:1:1:2:3:3:2:1:1:1:2:1:4:1:2:4:1:5: 1:1:1:1:1:1:2:1:2:3:1:1:1:1:2:3:2:1:1:1:1:1:2:1:1:3:1:3:2:6; t:="0":"1"; b:="0000":"0001":"0010":"0011":"0100":"0101":"0110":"0111":"1000": "1001":"1010":"1011":"1100":"1101":"1110":"1111"; h:="0":"1":"2":"3":"4":"5":"6":"7":"8":"9":"A":"B":"C":"D":"E":"F"; @For(i:=1;i<=@Elements(x);i:=i+1; s:=s+@Repeat(t[1+@Modulo(i-1;2)];x[i]) ); @For(j:=0;j<@length(s);j:=j+8; o:=o+h[@Member(@Middle(s;j;4);b)] + h[@Member(@Middle(s;j+4;4);b)] + " " ); o

Next challenges...

  • I made no effort to find the shortest solution in Notes @formulas languaage. So, find a shorter solution.

  • Do it in Notes R5 (so without @For) using the same technique (i.e., starting with a list of bit repeat lengths).

  • Do it in Notes R5 with any other technique. The shorter, the better.

  • Do it in LotusScript

This page has been accessed 339 times. .
Comments :v

1. Richard Schwartz05/05/2007 04:04:33 PM

Third bullet is addressed here:

Enter Comments^

Email addresses provided are not made available on this site.

You can use UUB Code in your posts.

[b]bold[/b]  [i]italic[/i]  [u]underline[/u]  [s]strikethrough[/s]

URL's will be automatically converted to Links

:-x :cry: :laugh: :-( :cool: :huh: :-) :angry: :-D ;-) :-p :grin: :rolleyes: :-\ :emb: :lips: :-o
bold italic underline Strikethrough

Remember me    

Monthly Archive
Responses Elsewhere

About The Schwartz


All opinions expressed here are my own, and do not represent positions of my employer.