Skip to main content
Commonmark migration
Source Link

#TI-BASIC, 13 12 bytes

TI-BASIC, 13 12 bytes

I found some 12 byte solutions

Ans-1:sum(Ansnot(fPart(Ans/2

The previous is the same byte count as below due to the line separator costing a byte

sum((Ans-1)2fPart(Ans/2

The above solutions use NfPart(Ans/N as a modulus operation to judge even/odd, giving us a list of dice that can have petals. Multiplying that by the original list -1 restores the petal counts to the list which can then be summed

2sum(Ans=3)+4sum(Ans=5

The original 13 byte solution simply compared the list once against 3 and separately against 5 before summing those results independently to get the petal count

All the above solutions take input as a list in Ans

#TI-BASIC, 13 12 bytes

I found some 12 byte solutions

Ans-1:sum(Ansnot(fPart(Ans/2

The previous is the same byte count as below due to the line separator costing a byte

sum((Ans-1)2fPart(Ans/2

The above solutions use NfPart(Ans/N as a modulus operation to judge even/odd, giving us a list of dice that can have petals. Multiplying that by the original list -1 restores the petal counts to the list which can then be summed

2sum(Ans=3)+4sum(Ans=5

The original 13 byte solution simply compared the list once against 3 and separately against 5 before summing those results independently to get the petal count

All the above solutions take input as a list in Ans

TI-BASIC, 13 12 bytes

I found some 12 byte solutions

Ans-1:sum(Ansnot(fPart(Ans/2

The previous is the same byte count as below due to the line separator costing a byte

sum((Ans-1)2fPart(Ans/2

The above solutions use NfPart(Ans/N as a modulus operation to judge even/odd, giving us a list of dice that can have petals. Multiplying that by the original list -1 restores the petal counts to the list which can then be summed

2sum(Ans=3)+4sum(Ans=5

The original 13 byte solution simply compared the list once against 3 and separately against 5 before summing those results independently to get the petal count

All the above solutions take input as a list in Ans

golfed a byte using mod 2
Source Link
TiKevin83
  • 420
  • 3
  • 6

#TI-BASIC, 1313 12 bytes

I found some 12 byte solutions

Ans-1:sum(Ansnot(fPart(Ans/2

The previous is the same byte count as below due to the line separator costing a byte

sum((Ans-1)2fPart(Ans/2

The above solutions use NfPart(Ans/N as a modulus operation to judge even/odd, giving us a list of dice that can have petals. Multiplying that by the original list -1 restores the petal counts to the list which can then be summed

2sum(Ans=3)+4sum(Ans=5

TakesThe original 13 byte solution simply compared the list once against 3 and separately against 5 before summing those results independently to get the petal count

All the above solutions take input as a list in Ans

#TI-BASIC, 13 bytes

2sum(Ans=3)+4sum(Ans=5

Takes input as a list in Ans

#TI-BASIC, 13 12 bytes

I found some 12 byte solutions

Ans-1:sum(Ansnot(fPart(Ans/2

The previous is the same byte count as below due to the line separator costing a byte

sum((Ans-1)2fPart(Ans/2

The above solutions use NfPart(Ans/N as a modulus operation to judge even/odd, giving us a list of dice that can have petals. Multiplying that by the original list -1 restores the petal counts to the list which can then be summed

2sum(Ans=3)+4sum(Ans=5

The original 13 byte solution simply compared the list once against 3 and separately against 5 before summing those results independently to get the petal count

All the above solutions take input as a list in Ans

Source Link
TiKevin83
  • 420
  • 3
  • 6

#TI-BASIC, 13 bytes

2sum(Ans=3)+4sum(Ans=5

Takes input as a list in Ans