Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ Challenge: Dubs and Trips

Name: Anonymous 2018-05-24 3:25

Basically a meme variation of FizzBuzz, but not exactly the same.

Write a program that outputs numbers between 1 and 1000 (inclusively). This is like a text board thread.

If it's dubs, instead of the number, print dubs. If trips, print trips. For trips, do NOT also output dubs. Only one or the other. If it's dubs or trips, do not include the number.

Example output:
987
dubs
989
990
991
992
993
994
995
996
997
998
trips


Notice that for 990, it doesn't output dubs, because it only counts for the last digits. And 999 only says trips, not dubs (even though it's also dubs, technically).

Name: Anonymous 2018-05-24 7:19

>>4
thanks, but tbh those are pretty basic FIOC golfing tricks: string multiplication instead of loop often saves you a lot of characters, py2 instead of 3 saves you one byte on print (one space instead of two parens) and the rest is just one-char variables and whitespace removal

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List