Activity for __blackjack__
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Answer | — |
A: Presumptuous base conversion Python 3, 60 59 bytes ```python D=input();m=int(max(D),16);print(m and int(D,m+1)or len(D)) ``` Quite straight forward implementation. Input string is assigned to `D`. `m` is the the `max()` letter in `D` converted to `int()` with base 16. `max()` works because Python strings/character... (more) |
— | over 1 year ago |
Answer | — |
A: "Hello, World!" Z80 Assembler, 50 bytes ```z80asm org 256 ld de,m ld c,9 jp 5 m:db"Hello, world!\r$" ``` With assembler there's usually the problem which machine or operating system the program is for. I've chosen CP/M here as it runs on a variety of different machines with a Z80 processor. CP/M progr... (more) |
— | over 1 year ago |
Answer | — |
A: Multiply complex numbers. Python 3, 63 bytes ```python print(str(eval(f"({input().replace(' ',')(')})")).strip("()")) ``` Try it online! Similar to hyper-neutrino's answer. Doesn't replace i by j and back, and uses f-string instead of strings and `+` to make it a bit shorter. (more) |
— | over 1 year ago |
Answer | — |
A: Cumulative Counts Python 3, 70 bytes ```python def f(a): d={};r=[] for x in a:d[x]=d.get(x,0)+1;r+=[d[x]] return r ``` Try it online! (more) |
— | over 1 year ago |
Answer | — |
A: Find n Niven Numbers Python, 98 bytes ```python from itertools import f=lambda n:[islice(filter(lambda k:k%sum(map(int,str(k)))==0,count(1)),n)] ``` `itertools.count()` generates integer numbers starting from 1, `filter()` filters out the Niven numbers, `itertools.islice()` limits the result to `n` items, ... (more) |
— | over 1 year ago |