Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

R, 47 39 bytes

as.double(substr(Sys.Date(),1,4))-0:120

If only someone invented a UTF-8 implementation of R with conveniently abbreviated frequently used system functions...

UPD: shaved off 7 (!) bytes owing to plannapusplannapus, who suggested subrtacting a 0:120 vector rather than counting from a to (a-120) and 1 byte grâce à user5957401user5957401, who noticed that double would work as well as numeric. Old version:

a=as.numeric(format(Sys.Date(),"%Y"));a:(a-120)

R, 47 39 bytes

as.double(substr(Sys.Date(),1,4))-0:120

If only someone invented a UTF-8 implementation of R with conveniently abbreviated frequently used system functions...

UPD: shaved off 7 (!) bytes owing to plannapus, who suggested subrtacting a 0:120 vector rather than counting from a to (a-120) and 1 byte grâce à user5957401, who noticed that double would work as well as numeric. Old version:

a=as.numeric(format(Sys.Date(),"%Y"));a:(a-120)

R, 47 39 bytes

as.double(substr(Sys.Date(),1,4))-0:120

If only someone invented a UTF-8 implementation of R with conveniently abbreviated frequently used system functions...

UPD: shaved off 7 (!) bytes owing to plannapus, who suggested subrtacting a 0:120 vector rather than counting from a to (a-120) and 1 byte grâce à user5957401, who noticed that double would work as well as numeric. Old version:

a=as.numeric(format(Sys.Date(),"%Y"));a:(a-120)
shaved off 8 bytes
Source Link

R, 4747 39 bytes

a=asas.numericdouble(formatsubstr(Sys.Date(),"%Y"1,4));a:(a-0:120)

If only someone invented a UTF-8 implementation of R with conveniently abbreviated frequently used system functions...

UPD: shaved off 7 (!) bytes owing to plannapus, who suggested subrtacting a 0:120 vector rather than counting from a to (a-120) and 1 byte grâce à user5957401, who noticed that double would work as well as numeric. Old version:

a=as.numeric(format(Sys.Date(),"%Y"));a:(a-120)

R, 47 bytes

a=as.numeric(format(Sys.Date(),"%Y"));a:(a-120)

If only someone invented a UTF-8 implementation of R with conveniently abbreviated frequently used system functions...

R, 47 39 bytes

as.double(substr(Sys.Date(),1,4))-0:120

If only someone invented a UTF-8 implementation of R with conveniently abbreviated frequently used system functions...

UPD: shaved off 7 (!) bytes owing to plannapus, who suggested subrtacting a 0:120 vector rather than counting from a to (a-120) and 1 byte grâce à user5957401, who noticed that double would work as well as numeric. Old version:

a=as.numeric(format(Sys.Date(),"%Y"));a:(a-120)
Source Link

R, 47 bytes

a=as.numeric(format(Sys.Date(),"%Y"));a:(a-120)

If only someone invented a UTF-8 implementation of R with conveniently abbreviated frequently used system functions...