Skip to main content
Commonmark migration
Source Link

#JavaScript (ES6) 29 (58 * 0.5)

JavaScript (ES6) 29 (58 * 0.5)

Edit remove ; thx @Optimizer

Q=o=>(m=>{for(n=o,r=[];n>m||++m<(n=o);)r.push(n--)})(0)||r

Test in FireFox/FireBug console

Q(9)

Output

[9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 9, 8, 7, 6, 5, 4, 9, 8, 7, 6, 5, 9, 8, 7, 6, 9, 8, 7, 9, 8, 9]

Ungolfed

Q=o=>{
  for(m=0,r=[];m<o;++m)
    for(n=o;n>m;)
      r.push(n--);
  return r
}

#JavaScript (ES6) 29 (58 * 0.5)

Edit remove ; thx @Optimizer

Q=o=>(m=>{for(n=o,r=[];n>m||++m<(n=o);)r.push(n--)})(0)||r

Test in FireFox/FireBug console

Q(9)

Output

[9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 9, 8, 7, 6, 5, 4, 9, 8, 7, 6, 5, 9, 8, 7, 6, 9, 8, 7, 9, 8, 9]

Ungolfed

Q=o=>{
  for(m=0,r=[];m<o;++m)
    for(n=o;n>m;)
      r.push(n--);
  return r
}

JavaScript (ES6) 29 (58 * 0.5)

Edit remove ; thx @Optimizer

Q=o=>(m=>{for(n=o,r=[];n>m||++m<(n=o);)r.push(n--)})(0)||r

Test in FireFox/FireBug console

Q(9)

Output

[9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 9, 8, 7, 6, 5, 4, 9, 8, 7, 6, 5, 9, 8, 7, 6, 9, 8, 7, 9, 8, 9]

Ungolfed

Q=o=>{
  for(m=0,r=[];m<o;++m)
    for(n=o;n>m;)
      r.push(n--);
  return r
}
added 31 characters in body
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90

#JavaScript (ES6) 29.5 (5958 * 0.5)

Edit remove ; thx @Optimizer

Q=o=>(m=>{for(n=o,r=[];n>m||++m<(n=o);)r.push(n--);})(0)||r

Test in FireFox/FireBug console

Q(9)

Output

[9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 9, 8, 7, 6, 5, 4, 9, 8, 7, 6, 5, 9, 8, 7, 6, 9, 8, 7, 9, 8, 9]

Ungolfed

Q=o=>{
  for(m=0,r=[];m<o;++m)
    for(n=o;n>m;)
      r.push(n--);
  return r
}

#JavaScript (ES6) 29.5 (59 * 0.5)

Q=o=>(m=>{for(n=o,r=[];n>m||++m<(n=o);)r.push(n--);})(0)||r

Test in FireFox/FireBug console

Q(9)

Output

[9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 9, 8, 7, 6, 5, 4, 9, 8, 7, 6, 5, 9, 8, 7, 6, 9, 8, 7, 9, 8, 9]

Ungolfed

Q=o=>{
  for(m=0,r=[];m<o;++m)
    for(n=o;n>m;)
      r.push(n--);
  return r
}

#JavaScript (ES6) 29 (58 * 0.5)

Edit remove ; thx @Optimizer

Q=o=>(m=>{for(n=o,r=[];n>m||++m<(n=o);)r.push(n--)})(0)||r

Test in FireFox/FireBug console

Q(9)

Output

[9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 9, 8, 7, 6, 5, 4, 9, 8, 7, 6, 5, 9, 8, 7, 6, 9, 8, 7, 9, 8, 9]

Ungolfed

Q=o=>{
  for(m=0,r=[];m<o;++m)
    for(n=o;n>m;)
      r.push(n--);
  return r
}
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90

#JavaScript (ES6) 29.5 (59 * 0.5)

Q=o=>(m=>{for(n=o,r=[];n>m||++m<(n=o);)r.push(n--);})(0)||r

Test in FireFox/FireBug console

Q(9)

Output

[9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 9, 8, 7, 6, 5, 4, 9, 8, 7, 6, 5, 9, 8, 7, 6, 9, 8, 7, 9, 8, 9]

Ungolfed

Q=o=>{
  for(m=0,r=[];m<o;++m)
    for(n=o;n>m;)
      r.push(n--);
  return r
}