취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

fizbuzz - a simple coding challenge

Woo! i can 기쁨 이모티콘 again!

 

I quite enjoyed this little challenge (compared to some of the mountains I have to climb at work!)  perhaps this could be a regular feature?

 

I'm sure it'd improve my coding (and others) to see some different approaches to problems. 

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 포인트
11/41 메시지
10,804 조회수

Why does everybody use so much duplicate code for the two Q&R operations. Simply divide by an array of [3,5]! Only one Q&R needed. 😮

 

Case structures are for wimps, so here's a solution that does not hide any code. 😄

 

 

스포일러
12/41 메시지
10,801 조회수

A slightly better version of my first attempt then:

 

스포일러
Fizzbuzz#2.JPG

 

-CC

 

p.s. what do case structures have to do with Dark Matter? (Wimps) 윙크 이모티콘

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


13/41 메시지
10,772 조회수

@altenbach wrote:

Why does everybody use so much duplicate code for the two Q&R operations. Simply divide by an array of [3,5]! Only one Q&R needed. 😮

 

Case structures are for wimps, so here's a solution that does not hide any code. 😄

 

 


 

I like these small challenges, learned about the  Q&R with array 🙂 

however the string conversion and replace array approach is executing worthless in 7/15*100 %

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 포인트
14/41 메시지
10,760 조회수

@Henrik Volkers wrote:
however the string conversion and replace array approach is executing worthless in 7/15*100 % 

If the problem had been to do it for all possible I32 integers and as fast as possible, I probably would have coded it quite differently. You need to find the right balance.

This is sufficient for the current problem. 😄

15/41 메시지
10,756 조회수

@jcarmody wrote:

@Henrik Volkers wrote:

I haven't tested it for speed, however I wanted to avoid two quotient&remainder vis 


I was referring to your first solution.


 

Closer to a TTL logic 😉 using shift registers instead of Q&R (Hey, I started soldering before programming 😉  and still miss the triode.vi 😄 ) , where is the obfuscation? 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


16/41 메시지
10,752 조회수

@P Anand wrote:

@Even Deejay wrote:

A nice task I hope I solved without any Rube Goldberg code기쁨 이모티콘

 

FizzBuzz.png 


Still small thing you have that kind. You could have used Equal2Zero.png instead of Equal2Zero - 1.png. 윙크 이모티콘


 

I enjoy reading these type so threads as well.

 

In my minds eye, I would prefer to find Even's approach with P Anand's mods. It is obvious "at a glance" what the code does. The other approaches are like trying to read one of my "quicky-replies". Yes there maybe an asnwer in there but you hvae to think to figure it out.

 

Thanks for the entertainment!

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
17/41 메시지
10,688 조회수

Thank you very much Ben for this kind of reply to my thread. 기쁨 이모티콘

-----

The best solution is the one you find it by yourself
0 포인트
18/41 메시지
10,686 조회수

here is my variation

 

puzzle.png

Regards
Ray Farmer
19/41 메시지
10,630 조회수

Since the interview was joined by marketing and the project leader, the optics was switched to silver and more features had to be included.

Who needed the progress bar (followed by a slow down to make it visible!)  couldn't be reconstructed by the protocol 😉

FFFF.pngFFFF-BD.png

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


20/41 메시지
10,609 조회수