|
Post by svajoklis on Jun 2, 2020 7:57:23 GMT -5
Welcome to week 5. The whole single point goes to tsh73. Thank you for pushing through and coming up with a solution! Weekly Challenge problem #5: Triangle numbers [level: olympiad]Triangle number is a number of dots, which can fill an equilateral triangle. For example, you can make a triangle out of three dots, so it's a triangle number. n-th triangle number is the number of dots in a triangle with side of n dots. Triangle number sequence is created like so: first triangle number is 1, second number is 2 bigger than first, third - 3 bigger than second and so on. Triangle number sequence is: 1, 3, 6, 10, 15... Write a program, that would determine if a number is a triangle number or not. Data format: Positive number in [1, 4294967296] entered with a keyboard. Output: The answer. Either "Yes" if number is a triangle number or "No" if number is not a triangle number. Example:Input/Output (keyboard, screen) | 2 No
6 Yes
28 Yes |
Should be easier than the last one. Let me know if I need to clarify the translations. I know I can sometimes be a bit off with that. Previous week's challenge:libertybasiccom.proboards.com/thread/1089/weekly-liberty-challenge-square-contours | Hall of Fame: | Total score | Score in last task |
---|
| timur77 | 3 | 0 | | Rod | 2.18 | 0 | | tsh73 | 2 | 1 | | svajoklis | 2 | 0 | | tenochtitlanuk | 1.95 | 0 |
|
|
|
Post by tsh73 on Jun 2, 2020 10:33:36 GMT -5
EDIT I swear it was 429 when I saw it Now it is 4294967296 I just took wrong time to look
|
|
|
Post by tenochtitlanuk on Jun 2, 2020 11:10:51 GMT -5
In English we say things ( like difficulty of problems) 'differ like chalk and cheese'. After half an hour I still did not understand the data format of the inputs of Challenge 5. EDIT Sorry- meant number 4. Well done Anatoly- much kudos! I get it now, by reverse engineering your solution.
This problem 5 is much more direct. I hadn't noticed before that 666 ( the Number of the Beast') is triangular. For fun I thought I'd draw the triangles, but my output device doesn't have the required resolution. Looks pretty up to low thousands.. My printer can only get to 300dpi across 8 inches... Anyone got an adequate one, say I rather hopefully and tongue-in-cheek!!
|
|
|
Post by svajoklis on Jun 2, 2020 12:45:08 GMT -5
tsh73, I can assure you, it was always 4294967296 tenochtitlanuk, this program works interactively, you input a number with your keyboard and an answer pops up
|
|
|
Post by tenochtitlanuk on Jun 2, 2020 18:11:33 GMT -5
Sorry- meant no. 4 format gave me difficulty- post edited.. input n test =8 *n +1 if ( test^0.5 -int( test^0.5 +1E-6)) <1E-6 then print "Yes" else print "No" end
|
|
|
Post by svajoklis on Jun 3, 2020 6:35:13 GMT -5
tenochtitlanuk, are you on Cinnamon desktop? Linux Mint maybe? I thought the title bar of the window looked very familiar
|
|
|
Post by tenochtitlanuk on Jun 3, 2020 11:55:10 GMT -5
Linux user for years ( but have access to a couple of W10 machines) and main machine is Mint- but I play with other versions. Currently trying Linux Lite - most of my machines are old, low-spec technology. Search the forum for 'Linux' and user 'tenochtitlanuk' for lots of my posts mentioning Linux. But many more posts were on the old forum that was killed by it's host, along with so many others...
|
|