21 lines what are you doing playing around like that? ;-))
_TITLE "Powerball 1-69 redball 1 to 26" 'b+ 2020-10-27 ' ref: https://www.google.com/search?client=opera&q=powerball+number+range&sourceid=opera&ie=UTF-8&oe=UTF-8
pb(i) = i
16 lines? PAH!! I can easily go half that! :P
PRINT "Here are your Powerball numbers:";
TAB(46 - (ct
- 1) * 3); x;
CHR$(10);
TAB(x
);
CHR$(0) 'the second line holds invisible spaces (chr$(0)) for used numbers PRINT "The red Powerball number is:";
INT(RND * 35) + 1
Hello
I did not mean to start a competition rotf but it was fun to watch. I was going to rewrite it using arrays and such on the same principal. If you dont need to peek and poke it is a good idea to not. but i just wanted a little more understanding of what he was doing. both programs are really cute.
Badger
It's all fun and games. bplus and I enjoy having fun pushing each other with different little challenges, with "shortest code" being one of the things we often compare.
I've got to admit though, sometimes, the code one of us ends up posting just absolutely blows my mind with what all can be done with just a minimal number of lines of coding. It's not always the prettiest, but it's sometimes astonishing to see a 100 line program can trim down to 10 lines, and still not look fundamentally different.
Warning though: After a few times of batting the numbers back and forth, always giving the other fellow a smaller target to shoot for, the code can often become quite obfuscated with obscure keywords, inane coding logic, or mystical voodoo which isn't always for the faint of heart to try and decipher. Shortest code possible isn't always the best code possible, but it is a nice exercise in logic for folks to play around with once they're comfortable with the language and want to challenge themselves to something different.
@bplus: 8 lines to you. Can you come up with something shorter, that's guaranteed not to produce duplicate values? ;D