Skip to main content
added 21 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38

Cobra

Really, this is quite trivial.

class Program
    def main
        for i in 10, Console.write(5 - Math.abs(5 - i))

Or

class Program
    def main
        v as int = 123454321
        for i in v.toString, Console.write(i)

Or even simpler

class Program
    def main
        print 1, 2, 3, 4, 5, 4, 3, 2, 1

But if you insist on following the question exactly:

class Program
    def main
        num as int = 123454321
        for i in '[num]',
            Console.write(i)
            Console.toString+'write(' ')

This uses only one integer variable, only one loop, and the only function explicitly called is used for output.

Cobra

Really, this is quite trivial.

class Program
    def main
        for i in 10, Console.write(5 - Math.abs(5 - i))

Or

class Program
    def main
        v as int = 123454321
        for i in v.toString, Console.write(i)

Or even simpler

class Program
    def main
        print 1, 2, 3, 4, 5, 4, 3, 2, 1

But if you insist on following the question exactly:

class Program
    def main
        num as int = 123454321
        for i in '[num]', Console.write(i.toString+' ')

This uses only one integer variable, only one loop, and the only function explicitly called is used for output.

Cobra

Really, this is quite trivial.

class Program
    def main
        for i in 10, Console.write(5 - Math.abs(5 - i))

Or

class Program
    def main
        v as int = 123454321
        for i in v.toString, Console.write(i)

Or even simpler

class Program
    def main
        print 1, 2, 3, 4, 5, 4, 3, 2, 1

But if you insist on following the question exactly:

class Program
    def main
        num as int = 123454321
        for i in '[num]'
            Console.write(i)
            Console.write(' ')

This uses only one integer variable, only one loop, and the only function explicitly called is used for output.

added 13 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38

Cobra

Really, this is quite trivial.

class Program
    def main
        for i in 10, Console.write(5 - Math.abs(5 - i))

Or

class Program
    def main
        v as int = 123454321
        for i in v.toString, Console.write(i)

Or even simpler

class Program
    def main
        print 1, 2, 3, 4, 5, 4, 3, 2, 1

But if you insist on following the question exactly:

class Program
    def main
        num as int = 123454321
        for i in '[num]', Console.write(i.toString+' ')

This uses only one integer variable, only one loop, and the only function explicitly called is used for output.

Cobra

Really, this is quite trivial.

class Program
    def main
        for i in 10, Console.write(5 - Math.abs(5 - i))

Or

class Program
    def main
        v as int = 123454321
        for i in v.toString, Console.write(i)

Or even simpler

class Program
    def main
        print 1, 2, 3, 4, 5, 4, 3, 2, 1

But if you insist on following the question exactly:

class Program
    def main
        num as int = 123454321
        for i in '[num]', Console.write(i)

This uses only one integer variable, only one loop, and the only function explicitly called is used for output.

Cobra

Really, this is quite trivial.

class Program
    def main
        for i in 10, Console.write(5 - Math.abs(5 - i))

Or

class Program
    def main
        v as int = 123454321
        for i in v.toString, Console.write(i)

Or even simpler

class Program
    def main
        print 1, 2, 3, 4, 5, 4, 3, 2, 1

But if you insist on following the question exactly:

class Program
    def main
        num as int = 123454321
        for i in '[num]', Console.write(i.toString+' ')

This uses only one integer variable, only one loop, and the only function explicitly called is used for output.

added 354 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38

Cobra

Really, this is quite trivial.

class Program
    def main
        for i in 10, Console.write(5 - Math.abs(5 - i))

Or

class Program
    def main
        v as int = 123454321
        for i in v.toString, Console.write(i)

Or even simpler

class Program
    def main
        print 1, 2, 3, 4, 5, 4, 3, 2, 1

But if you insist on following the question exactly:

class Program
    def main
        num as int = 123454321
        for i in '[num]', Console.write(i)

This uses only one integer variable, only one loop, and the only function explicitly called is used for output.

Cobra

class Program
    def main
        for i in 10, Console.write(5 - Math.abs(5 - i))

Or

class Program
    def main
        v as int = 123454321
        for i in v.toString, Console.write(i)

Or even simpler

class Program
    def main
        print 1, 2, 3, 4, 5, 4, 3, 2, 1

Cobra

Really, this is quite trivial.

class Program
    def main
        for i in 10, Console.write(5 - Math.abs(5 - i))

Or

class Program
    def main
        v as int = 123454321
        for i in v.toString, Console.write(i)

Or even simpler

class Program
    def main
        print 1, 2, 3, 4, 5, 4, 3, 2, 1

But if you insist on following the question exactly:

class Program
    def main
        num as int = 123454321
        for i in '[num]', Console.write(i)

This uses only one integer variable, only one loop, and the only function explicitly called is used for output.

added 148 characters in body
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38
Loading
Source Link
Οurous
  • 8.1k
  • 1
  • 16
  • 38
Loading