| Bytes | Lang | Time | Link |
|---|---|---|---|
| 150 | Plain TeX | 250316T001120Z | jlab |
| 151 | Tcl | 170822T214232Z | sergiol |
| 076 | Japt | 170822T175500Z | Shaggy |
| 163 | VBA for Word | 210717T152149Z | Axuary |
| 117 | Bash + Core Utils | 170823T171625Z | 0x2b3bfa |
| 830 | Cubically | 170822T193316Z | MD XF |
| 128 | Java OpenJDK 8 | 170823T083135Z | Olivier |
| 132 | Excel VBA | 170822T180713Z | Taylor R |
| 206 | SQL | 170831T214727Z | PreQL |
| 134 | PowerShell | 170825T085950Z | Tessella |
| 1331 | PHP | 170824T222723Z | Titus |
| 116 | Pyth | 170822T172238Z | Mr. Xcod |
| 057 | Jelly | 170822T175017Z | Erik the |
| 168 | C gcc | 170824T134723Z | Cole Cam |
| 118 | Recursiva | 170822T172033Z | 0xffcour |
| 118 | Cinnamon Gum | 170824T031953Z | totallyh |
| 183 | SimpleTemplate | 170824T005630Z | Ismael M |
| 178 | R | 170823T083935Z | AndriusZ |
| 130 | Bash + Core Utils Grep 130 Bytes | 170823T030649Z | markasof |
| 125 | Dyalog APL | 170823T185555Z | Adalynn |
| 181 | ><> | 170823T180934Z | Business |
| 155 | R | 170823T143937Z | Sven Hoh |
| 127 | Ruby | 170823T142920Z | daniero |
| 110 | Gaia | 170822T180818Z | Business |
| 198 | C++ | 170822T172517Z | Steadybo |
| 190 | C gcc | 170822T174437Z | cleblanc |
| nan | 170823T084749Z | auhmaan | |
| 154 | EXCEL | 170823T091843Z | Wernisch |
| 271 | C# | 170822T224452Z | snorepio |
| 131 | Dyalog APL | 170822T172447Z | Uriel |
| 145 | Haskell | 170822T212935Z | Leif Wil |
| 073 | Charcoal | 170822T185337Z | Neil |
| 136 | JavaScript ES6 | 170822T174821Z | Arnauld |
| 117 | Pyke | 170822T174612Z | Mr. Xcod |
| 081 | SOGL V0.12 | 170822T171735Z | dzaima |
| 125 | V | 170822T171743Z | DJMcMayh |
| 139 | Python 3 | 170822T171720Z | Mr. Xcod |
Plain TeX, 150 bytes
\def~#1{{\let~\or#1\ifcase\numexpr`#1-`C upcake~onut~clair~royo~ingerbread~oneycomb~ce Cream Sandwich~ellybean~itkat~ollipop~arshmallow~ougat~reo\fi}}
But this works only for upper case letters.
Explanation
\def~#1{%
{% open a group: make \let~\or local
\let~\or% now ~ means \or
#1% print the letter
\ifcase\numexpr`#1-`C% compute the position (`#1 is the ASCII code of the letter)
upcake
~onut
~clair
~royo
~ingerbread
~oneycomb
~ce Cream Sandwich
~ellybean
~itkat
~ollipop
~arshmallow
~ougat
~reo
\fi% \ifcase end
}% close the group
}
Test cases
\def~#1{{\let~\or#1\ifcase\numexpr`#1-`C upcake~onut~clair~royo~ingerbread~oneycomb~ce Cream Sandwich~ellybean~itkat~ollipop~arshmallow~ougat~reo\fi}}
~{F}
~{I}
~{J}
~{N}
~{G}
~{L}
\bye
Tcl, 151 bytes
proc A s {puts $s[lindex {upcake onut clair royo ingerbread oneycomb "ce Cream Sandwich" ellybean itkat ollipop arshmallow ougat reo} [scan $s %c]-67]}
Japt, 81 79 76 bytes
+cg`Æ+tfÆ÷¯kef©fclairfê $ßdfey¬mbf ×Äm ÑØrfÁKÞ fkfo¥ipopfÂâÚaow`qf
Try it (includes all test cases)
- 2 bytes saved thanks to Oliver.
+cg`...`qf :Implicit input of character string
+ :Append
c : Character code
g : Index into (0-based, with wrapping)
`...` : Compressed string "ougatfreofupcakefonutfclairfroyofingerbreadfoneycombfce cream sandwichfellybeanfitkatfollipopfarshmallow"
qf : Split on "f"
VBA for Word, 163 bytes
a=left(ActiveDocument.Range.Text,1):?a+Split("upcake onut clair royo ingerbread oneycomb ce cream sandwich ellybean itkat ollipop arshmallow ougat reo")(asc(a)-67)
@tisaconundrum asked for Word. The closest I can get is a port of VBA for Excel solution by @TaylorScott.
Bash + Core Utils 131 128 122 117 bytes.
The script is encoded as Base64 because it contains special (weird) characters.
Accepts the Android codename letter only in lowercase as its first positional parameter. Returns the full codename also in lowercase.
CiPBUeICicG5tJ8W5a0Pc/hYuw7hkNMSIYkAPjARkdgFrdbh3NJgTmB4gRPiiQDJAaOyBH4ki14C
QDeKRNQJ8IJYER411DAnx0SO4CAKYmFzZTMyICQwfHRyICdBLVo0NwonICdhLXoKICd8Z3JlcCBe
JDEK
Explanation:
#�Q��������s�X����!�>0�������`N`x������~$�^@7�D� ��X5�0'�D��
base32 $0|tr 'A-Z47
' 'a-z
'|grep ^$1
- The first two lines are the binary blob with the data (see a the end of the answer for more information). The first line is empty, to avoid problems with Bash, as otherwise it may think that is being fed with a binary file.
base32 $0encodes the script contents with Base32, with the default line wrapping of 76 characters.tr 'A-Z47\n' 'a-z\n '(note that the\nis written as a literal newline) will lowercase the input and replace 4, 7 and\nby\n, space and space respectively.grep ^$1will output the lines matching the string provided as first argument to the script.
Binary data
This octet stream was forged so it doesn't contain newlines and when it's decoded with Base32 as per RFC 4648, the resulting string is the list of Android codenames (using 4 as item delimiter and 7 to replace the space character). Among its peculiarities, it begins with a newline character and a hash (#) so it behaves as a comment and, therefore, isn't executed by the interpreter.
Also, the default line wrapping to 76 characters of this Base32 implementation helped me a byte, as I reordered the items to use the line break as one of the Ice cream sandwich spaces.
Also, and going a bit off-topic, I think that Google shouldn't indirectly advertise commercial products in the Android codenames.
Cubically, 1047 852 830 bytes
Functions sure help golf large programs...
⇒+552
⇒+551
⇒+553
⇒+55
⇒/1+52
⇒/1+53
~@7+4f5=?{:5+53@:4/1f1@:5+51@:5+2/1f4@:5+3/1f2@:2/1f2@}
+5f5=?{:3/1f1@:2/1f1@:5+53@:5+3/1f1@}
+51f5=?{:5+51@+1@:5+2/1f4@:5+1/1+551@+1@}
+52f5=?{:5+1/1f1@:3/1f1@:4/1f3@:3/1f1@}
+53f5=?{:5+1/1f2@:2/1f1@:4/1f2@:2/1f2@:5+1/1f1@:5+3/1f4@:5+1/1f1@:2/1f2@:5+2/1f4@:1/1f2@}
+53=?{:3/1f1@:2/1f1@-1@:4/1f3@:5+51@:3/1f1@:1/1f1@:5+3/1f4@}
+1f6=?{:5+51@:2/1f2@:5/1+3@:4/1+52@:5+1/1f1@:2/1f2@:5+2/1+55@:1/1f1@:5/1+3@:2/1+54@:5+2/1f4@6:2/1f1@6:1/1f2@6:2/1f3@6:5+1/1f2@6:5+51@6:5/1f2@6}
+2f6=?{:2/1f2@:5+52@@:4/1f3@:5+3/1f4@:2/1f2@:5+2/1f4@:2/1f1@}
+3f6=?{:5+1/1f2@:5+3/1f1@-1@:5+2/1f4@:5+3/1f1@}
+4f6=?{:3/1f1@:5+52@@:5+1/1f2@:4/1f1@:3/1f1@:4/1f1@}
+5f6=?{:5+2/1f4@:5+1/1f1@:5+2/1f1@:5/1f2@:1/1f1@:5+2/1f4@:5+52@@:3/1f1@:2/1f3}
+51f6=?{:3/1f1@:5+53@:4/1f2@:5+2/1f4@:5+3/1f1@}
+52f6=?{:5+1/1f1@:2/1f2@:3/1f1@}
Try it online! This is 830 bytes in Cubically's SBCS.
~reads input,@prints it. (This breaks when the input is invalid.)- Each of the
+.../...+...=7?6{...}compares the input to each ASCII value (C,D,E,F, etc) and executes the code within{...}if they are equal. - Each code block (
{...}) prints the rest of the name (the first character is already printed).
Thanks to TehPers' ASCII to Cubically translator which was very helpful.
Java (OpenJDK 8), 128 bytes
c->c+"upcake#onut#clair#royo#ingerbread#oneycomb#ce Cream Sandwich#ellybean#itkat#ollipop#arshmallow#ougat#reo".split("#")[c-67]
Using regexes, 149 bytes
s->"CupcakeDonutEclairFroyoGingerbreadHoneycombIce cream sandwichJellybeanKitkatLollipopMarshmallowNougatOreo".replaceAll(".*?("+s+"[a-z ]+).*","$1")
- 4 bytes saved on the regex solution thanks to Kevin Cruijssen!
Excel VBA, 137 134 132 Bytes
Anonymous VBE immediate window function that takes input as expected type Variant\String and length 1 holding a capital letter from cell [A1] and outputs to the VBE immediate window function
?[A1]Split("upcake onut clair royo ingerbread oneycomb ce cream sandwich ellybean itkat ollipop arshmallow ougat reo")(Asc([A1])-67)
-5 Bytes for changing the spaces in ce cream sandwich from (char 32) to `` (char 127) and removing comma delimiter in the (char 160)Split function
SQL, 2017, 206 bytes
Assuming a function/procedure would have to be created otherwise you can't take input.
CREATE PROCEDURE X(@x VARCHAR)AS SELECT*FROM STRING_SPLIT('Cupcake,Donut,Eclair,Froyo,Gingerbread,Honeycomb,Ice cream sandwich,Jellybean,Kitkat,Lollipop,Marshmallow,Nougat,Oreo',',') WHERE value like @x+'%'
Cannot find a place to show this version online so there's a "slightly" more version-friendly submission
SQL, 244 bytes
CREATE PROCEDURE Y(@y VARCHAR,@x VARCHAR(999)='CupcakeDonutEclairFroyoGingerbreadHoneycombIce cream sandwichJellybeanKitkatLollipopMarshmallowNougatOreoP')AS SELECT STUFF(STUFF(@x,CHARINDEX(CHAR(ASCII(@y)+1),@x),999,''),1,CHARINDEX(@y,@x)-1,'')
Things to note, this is on a case-sensitive database therefore the delimiter could be the capital letter.
Explanation
Database is case-sensitive
Inner STUFF - removes everything from the the next capital letter in alphabet
Outer STUFF - removes everything before the input capital letter
SQL Fiddle worked example, not able to show a case sensitive database online so changed to a comma delimited list that works the same.
PowerShell, 136 134 bytes
param($c)$c+('upcake0onut0clair0royo0ingerbread0oneycomb0ce cream sandwich0ellybean0itkat0ollipop0arshmallow0ougat0reo'-split0)[$c-99]
Takes a [char] input character, in lowercase, and outputs in lowercase.
-2 thanks to AdmBorkBork's suggestion to -split0 instead of -split','.
PHP, 133+1 bytes
<?=$argn,[upcake,onut,clair,royo,ingerbread,oneycomb,"ce Cream Sandwich",ellybean,itkat,ollipop,arshmallow,ougat,reo][ord($argn)-67];
no TiO this time. Run as pipe with -nR.
Pyth, 117 116 bytes
Port of my Python answer.
+Q@c"upcake,onut,clair,royo,ingerbread,oneycomb,ce cream sandwich,ellybean,itkat,ollipop,arshmallow,ougat,reo"\,a67C
Try it here! or Check out the Test Suite
Pyth, 99 bytes (70 characters)
-15 bytes thanks to @insert_name_here!
+Q@c." y|çEC#nZÙ¦Y;åê½9{ü/ãѪ#¤
ØìjX\"¦Hó¤Ê#§T£®úåâ«B'3£zÞz~Уë"\,a67C
Jelly, 57 bytes
Oị“¡ȥọ⁴ḷæĿɱ}#n#i®ÞSỊ3ƙɼıjṁ)-⁵g7ḥjC?4ƘẠʂ+ḋ¤⁺jṣð£?v»Ḳ¤F⁾! y
-5 thanks to Jonathan Allan.
C (gcc), 168 bytes
main(){puts(memchr("Cupcake\0Donut\0Eclair\0Froyo\0Gingerbread\0Honeycomb\0Ice cream sandwich\0Jellybean\0Kitkat\0Lollipop\0Marshmallow\0Nougat\0Oreo",getchar(),117));}
Recursiva, 130 119 118 bytes
+aYQ'upcake!onut!clair!royo!ingerbread!oneycomb!ce cream sandwich!ellybean!itkat!ollipop!arshmallow!ougat!reo''!'-Oa99
- saved 11 bytes thanks to @Mr.Xcoder's idea
Cinnamon Gum, 118 bytes
Hexdump:
0000000: 6c0d cac9 1183 300c 05d0 5638 fd26 74cc l.....0...V8.&t.
0000010: bed7 2084 020e b2c5 0818 c6dd 87eb 9b77 .. ............w
0000020: 80ac 93f0 a874 44e7 655d e804 15e3 1474 .....tD.e].....t
0000030: c637 bc3a 5dd0 a7d2 6bb4 a1dc d115 8317 .7.:]...k.......
0000040: ade2 b9a5 1b92 6823 bbe7 66e6 d26d 4906 ......h#..f..mI.
0000050: bae3 a766 b555 2ef4 c098 9691 177a c2dc ...f.U.......z..
0000060: 2c4d 3ed1 0b99 631e 329b f946 6f14 5ffb ,M>...c.2..Fo._.
0000070: 7d7c e0a1 fe07 }|....
SimpleTemplate, 183 bytes
This just simply checks if the first letter of the word is the same or not.
Nothing super fancy.
{@setl"Cupcake","Donut","Eclair","Froyo","Gingerbread","Honeycomb","Ice Cream Sandwich","Jellybean","Kitkat","Lollipop","Marshmallow","Nougat","Oreo"}{@eachl}{@ifargv.0 is_.0}{@echo_}
Ungolded:
{@// array with all the names}
{@set list "Cupcake", "Donut", "Eclair", "Froyo", "Gingerbread", "Honeycomb", "Ice Cream Sandwich", "Jellybean", "Kitkat", "Lollipop", "Marshmallow", "Nougat", "Oreo"}
{@each list as name}
{@if argv.0 is name.0} {@// name.0 -> first character}
{@echo name}
{@/}
{@/}
Try it on http://sandbox.onlinephpfunctions.com/code/002cfd9c5a84546dac3a656f6011b998ccfe33af
R, 131, 126, 123, 112, 178 bytes
grep(paste0('^',scan(,'')),c("Cupcake","Donut","Eclair","Froyo","Gingerbread","Honeycomb","Ice Cream Sandwich","Jellybean","Kitkat","Lollipop","Marshmallow","Nougat","Oreo"),v=T)
Thanks for @Mark for saving 5 + 8 + 3 bytes
Bash + Core Utils (Grep): 132 130 Bytes
Simple as could be
grep ^$1<<<'Cupcake
Donut
Eclair
Froyo
Gingerbread
Honeycomb
Ice Cream Sandwich
Jellybean
Kitkat
Lollipop
Marshmallow
Nougat
Oreo'
Dyalog APL, 125 bytes
{⍵/⍨⍞=⎕A[+\⍵∊⎕A]}'ABCupcakeDonutEclairFroyoGingerbreadHonecombIce cream sandwichJellybeanKitkatLollipopMarshmallowNougatOreo'
How?
⍵∊⎕A⍵(the long string) with 1 for capital letters, 0 for lowercase/spaces.+\Group (returning numbers) ⍵ by capital letters.⎕A[...]The capital letter signified by a number⍵/⍨⍞=The group signified by that number{...}'...'Set⍵to the long string
><>, 181 bytes
!vi:od5*-0$6a*@p!
v<
v"upcake"
v"onut"
v"clair"
v"royo"
v"ingerbread"
v"oneycomb"
v"ce Cream Sandwich"
v"ellybean"
v"itkat"
v"ollipop"
v"arshmallow"
v"ougat"
v"reo"
o<>
This works by self-modifying the program to place a < in front of the correct name to print, the position of which is determined by the value of the inputted letter.
R, 169 155 bytes
sub(paste0(".*(",scan(,""),"[^A-Z]+).*"),"\\1","CupcakeDonutEclairFroyoGingerbreadHoneycombIce cream sandwichJellybeanKitkatLollipopMarshmallowNougatOreo")
Ruby, 127 bytes
->c{c+%w[upcake onut clair royo ingerbread oneycomb ce\ Cream\ Sandwich ellybean itkat ollipop arshmallow ougat reo][c.ord-67]}
Takes uppercase input. Try it online!
Gaia, 110 bytes
:c“reo“upcake“onut“clair“royo“ingerbread“oneycomb“ce Cream Sandwich“ellybean“itkat“ollipop“arshmallow“ougat”=+
Explanation
: Push two copies of the input
c Get the codepoint of the top one
“...” Push the list of version names without their first letters
= Modularly index the code point into the list
+ Append to the input
C++, 206 201 198 bytes
Thanks to @sergiol for helping to save 3 bytes!
#import<cstdio>
void f(int l){char*w[]={"upcake","onut","clair","royo","ingerbread","oneycomb","ce Cream Sandwich","ellybean","itkat","ollipop","arshmallow","ougat","reo"};printf("%c%s",l,w[l-67]);}
C, 173 bytes
f(l){char*w[]={"upcake","onut","clair","royo","ingerbread","oneycomb","ce Cream Sandwich","ellybean","itkat","ollipop","arshmallow","ougat","reo"};printf("%c%s",l,w[l-67]);}
Well, it started as C++, but now it's also valid C, and some bytes can be saved by compiling it as C.
C (gcc), 195 192 190 bytes
-2 bytes thanks to @Quentin
*V[]={"upcake","onut","clair","royo","ingerbread","oneycomb","ce Cream Sandwich","ellybean","itkat","ollipop","arshmallow","ougat","reo"};main(c,v)char**v;{printf("%c%s",c,V[(c=*v[1])-67]);}
C#, 147 136 129 bytes
Data
- Input
CharcThe first letter of the version name - Output
StringThe full name of the version
Golfed
// Requires the input to be uppercase.
// This is the one counting for the challange
c=>c+"upcake,onut,clair,royo,ingerbread,oneycomb,ce Cream Sandwich,ellybean,itkat,ollipop,arshmallow,ougat,reo".Split(',')[c-67];
// Optional. Requires the input to be lowercase.
c=>c+"upcake,onut,clair,royo,ingerbread,oneycomb,ce Cream Sandwich,ellybean,itkat,ollipop,arshmallow,ougat,reo".Split(',')[c-99];
// Optional. Works with both uppercase and lowercase with the additional cost of 10 bytes.
c=>c+"upcake,onut,clair,royo,ingerbread,oneycomb,ce Cream Sandwich,ellybean,itkat,ollipop,arshmallow,ougat,reo".Split(',')[c-(c<99?67:99)];
Ungolfed
c =>
c + "upcake,onut,clair,royo,ingerbread,oneycomb,ce Cream Sandwich,ellybean,itkat,ollipop,arshmallow,ougat,reo"
.Split( ',' )[ c - 67 ];
Ungolfed readable
// Takes a char
c =>
// Appends the input letter to...
c +
// ... the name in the resulting index of the subtraction of the char with 67 ('C'), or with 99 ('c') for the lowercase version
"upcake,onut,clair,royo,ingerbread,oneycomb,ce Cream Sandwich,ellybean,itkat,ollipop,arshmallow,ougat,reo"
.Split( ',' )[ c - 67 ];
// Takes a char
c =>
// Appends the input letter to...
c +
// ... the name in the resulting index of the subtraction of the char with 67 ('C') if the char is uppercase ( 'C' == 67, 'O' == 79 )
// or with 99 ('c') if the char is lowercase ( 'c' == 99, 'o' == 111 )
"upcake,onut,clair,royo,ingerbread,oneycomb,ce Cream Sandwich,ellybean,itkat,ollipop,arshmallow,ougat,reo"
.Split( ',' )[ c - ( c < 99 ? 67 : 99 ) ];
Full code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestBench {
public static class Program {
private static Func<Char, String> f = c =>
c + "upcake,onut,clair,royo,ingerbread,oneycomb,ce Cream Sandwich,ellybean,itkat,ollipop,arshmallow,ougat,reo"
.Split( ',' )[ c - 67 ];
static void Main( string[] args ) {
List<Char>
testCases = new List<Char>() {
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
};
foreach(Char testCase in testCases) {
Console.WriteLine($" Input: {testCase}\nOutput: {f(testCase)}\n");
}
Console.ReadLine();
}
}
}
Releases
- v1.0 -
147 bytes- Initial solution. - v1.1 -
-11 bytes- Borrowed Olivier Grégoire's idea. - v1.2 -
- 7 bytes- Changed the function input from explicit to implicit.
Notes
- None
EXCEL, 154 bytes
=A1&CHOOSE(CODE(A1)-66,"upcake","onut","clair","royo","ingerbread","oneycomb","ce Cream Sandwich","ellybean","itkat","ollipop","arshmallow","ougat","reo")
C#, 271 characters
var i="Cupcake|Donut|Eclair|Froyo|Gingerbread|Honeycomb|Ice cream sandwich|Jellybean|Kitkat|Lollipop|Marshmallow|Nougat|Oreo";var s=i.Split('|');int b;var c=new char[12];for(b=0;b<12;b++){c[b]=s[b][0];}for(b=0;b<12;b++){if(Console.Read().ToString()[0]==c[b])return s[b];}
Accepts one character from the console input stream, then returns the correct version number. Please tell me if I've done anything wrong or omitted something that should be here, this is my first time golfing.
Dyalog APL, 158 143 131 bytes
1 byte saved thanks to @Zacharý
12 bytes saved thanks to @Gil
{⍵,(⎕A⍳⍵)⊃','(1↓¨=⊂⊢)',,,upcake,onut,clair,royo,ingerbread,oneycomb,ce Cream Sandwich,ellybean,itkat,ollipop,arshmallow,ougat,reo'}
How?
',,,upcake...' - list of words
','(1↓¨=⊂⊢) - split by ','
(⎕A⍳⍵)⊃ - take from the place of the argument in the alphabet
⍵, - and append to the letter
Haskell, 145 bytes
f c=takeWhile(/=succ c)$dropWhile(/=c)"CupcakeDonutEclairFroyoGingerbreadHoneycombIce Cream SandwichJellybeanKitkatLollipopMarshmallowNougatOreo"
Charcoal, 73 bytes
θ§⪪”%↖↙1¬¢/vy⁵⸿ψJPP±≔S×5JρνξGu ◧;Yx³F▶ψ;εB↥:P¹N﹪J$α✂χ✳⦄⟲*±¶Sp:ς↘V◧◧”x℅θ
Try it online! I/O is in lower case. Based on this verbose version. Explanation:
Implicitly print:
θ Input character
Implicitly print:
”...” Long compressed string "oneycombx...xingerbread"
⪪ Split on
x The string "x"
§ Circularly indexed by
℅ Character code of
θ Input character
JavaScript (ES6), 137 136 bytes
Saved 1 byte thanks to Neil
c=>'CupcakeDonutEclairFroyoGingerbreadHoneycombIce Cream SandwichJellybeanKitkatLollipopMarshmallowNougatOreo'.match(c+'([a-z]| .)+')[0]
Demo
let f =
c=>'CupcakeDonutEclairFroyoGingerbreadHoneycombIce Cream SandwichJellybeanKitkatLollipopMarshmallowNougatOreo'.match(c+'([a-z]| .)+')[0]
;[...'CDEFGHIJKLMNO'].map(c => console.log(c, '->', f(c)))
Pyke, 117 bytes
Port of my Python answer.
"upcake,onut,clair,royo,ingerbread,oneycomb,ce cream sandwich,ellybean,itkat,ollipop,arshmallow,ougat,reo"\,cQ.o67-@+
Encoded as hex codes, the new technique of golfing in Pyke, it would be 116 bytes:
22 75 70 63 61 6B 65 2C 6F 6E 75 74 2C 63 6C 61 69 72 2C 72 6F 79 6F 2C 69 6E 67 65 72 62 72 65 61 64 2C 6F 6E 65 79 63 6F 6D 62 2C 63 65 20 63 72 65 61 6D 20 73 61 6E 64 77 69 63 68 2C 65 6C 6C 79 62 65 61 6E 2C 69 74 6B 61 74 2C 6F 6C 6C 69 70 6F 70 2C 61 72 73 68 6D 61 6C 6C 6F 77 2C 6F 75 67 61 74 2C 72 65 6F 22 5C 2C 63 51 EF 36 37 2D 40 2B
(Paste in and check Use hex encoding?).
SOGL V0.12, 81 bytes
]&ŗ√‰fō¶č▓'▼$»3↕█γb└a}⅟∑─b¹¦Æ:↕┘∞½Σ#gī±⅔≡≥\3Qy-7todΥ7ā‼D←εPρρ:¬c‰ƨ}f沑θ╔@ŗz,WHHw
Explanation:
...‘ push "cupcake donut eclair froyo gingerbread honeycomb ice_cream_sandwich jellybean kitkat lollipop marshmallow nougat oreo"
θ split on spaces
╔@ŗ replace underscores with spaces
z,W find the inputs index in the lowercase alphabet
HH decrease by 2
w get that item from the array
Now there is a shorter 80 byte version, but I added the +2/-2 built-ins because of this challenge :p
The compressed string is split like "cup","cake"," donut eclair fro","yo gingerbread honeycomb ice","_","cream","_","sandwich jelly","bean kit","kat loll","i","pop marsh","mallow"," nougat oreo" for maximum usage of english words (many weren't in SOGLs dictionary), right now I can't find any improvements.
V, 125 bytes
Ccupcake
donut
eclair
froyo
gingerbread
honeycomb
ice cream sandwich
jellybean
kitkat
lollipop
marshmallow
nougat
oreoÇ^"/d
Python 3, 139 bytes
lambda x:x+'upcake,onut,clair,royo,ingerbread,oneycomb,ce cream sandwich,ellybean,itkat,ollipop,arshmallow,ougat,reo'.split(",")[ord(x)-67]
