Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Post Undeleted by Cong Chen
added 150 characters in body
Source Link
Cong Chen
  • 921
  • 4
  • 8

R, 174172 bytes (thanks Razetime for corrections)

Takes input as a list of strings, returns a named vector. Just eval in R with aggressive escaping using the A character.

function(i){i=paste(gsub('([a-z_])', '\1円.''A\1円',i)[grepl('=',i)],collapse=';')
eval(parse(text=i))
rm("i")
u=ls()
x=sapply(u,function(name)get(name))
names(x)=gsub('\\.''A','',u)
x}

Try it online! Try it online!

R, 174 bytes (thanks Razetime for corrections)

Takes input as a list of strings, returns a named vector. Just eval in R with aggressive escaping.

function(i){i=paste(gsub('([a-z_])', '\1円.',i)[grepl('=',i)],collapse=';')
eval(parse(text=i))
rm("i")
u=ls()
x=sapply(u,function(name)get(name))
names(x)=gsub('\\.','',u)
x}

Try it online!

R, 172 bytes

Takes input as a list of strings, returns a named vector. Just eval in R with aggressive escaping using the A character.

function(i){i=paste(gsub('([a-z_])', 'A\1円',i)[grepl('=',i)],collapse=';')
eval(parse(text=i))
rm("i")
u=ls()
x=sapply(u,function(name)get(name))
names(x)=gsub('A','',u)
x}

Try it online!

Post Deleted by Cong Chen
Post Undeleted by Cong Chen
added 150 characters in body
Source Link
Cong Chen
  • 921
  • 4
  • 8

R, 115174 bytes - INCORRECT (thanks Razetime for corrections)

Takes input as a list of strings, returns a named vector. Just eval in R with aggressive escaping.

function(i){i=paste(i[greplgsub('([a-z_])', '\1円.',i)[grepl('=',i)],collapse=';')
eval(parse(text=i))
rm("i")
sapply(lsu=ls()
x=sapply(u,function(name)get(name))
names(x)=gsub('\\.','',u)
x}

Try it online! Try it online!

R, 115 bytes - INCORRECT (thanks Razetime)

Takes input as a list of strings, returns a named vector. Just eval in R.

function(i){i=paste(i[grepl('=',i)],collapse=';')
eval(parse(text=i))
rm("i")
sapply(ls(),function(name)get(name))}

Try it online!

R, 174 bytes (thanks Razetime for corrections)

Takes input as a list of strings, returns a named vector. Just eval in R with aggressive escaping.

function(i){i=paste(gsub('([a-z_])', '\1円.',i)[grepl('=',i)],collapse=';')
eval(parse(text=i))
rm("i")
u=ls()
x=sapply(u,function(name)get(name))
names(x)=gsub('\\.','',u)
x}

Try it online!

Post Deleted by Cong Chen
added 89 characters in body
Source Link
Cong Chen
  • 921
  • 4
  • 8

R, 115 bytes - INCORRECT (thanks Razetime )

Takes input as a list of strings, returns a named vector. Just eval in R.

function(i){i=paste(i[grepl('=',i)],collapse=';')
eval(parse(text=i))
rm("i")
sapply(ls(),function(name)get(name))}

Try it online!

R, 115 bytes

Takes input as a list of strings, returns a named vector. Just eval in R.

function(i){i=paste(i[grepl('=',i)],collapse=';')
eval(parse(text=i))
rm("i")
sapply(ls(),function(name)get(name))}

Try it online!

R, 115 bytes - INCORRECT (thanks Razetime )

Takes input as a list of strings, returns a named vector. Just eval in R.

function(i){i=paste(i[grepl('=',i)],collapse=';')
eval(parse(text=i))
rm("i")
sapply(ls(),function(name)get(name))}

Try it online!

Source Link
Cong Chen
  • 921
  • 4
  • 8
Loading

AltStyle によって変換されたページ (->オリジナル) /