WeixiangYan/CodeTransOcean huggingface dataset:
Task: Abundant odd numbers





Java: import java.util.ArrayList;
import java.util.List;

public class AbundantOddNumbers {
    private static List<Integer> list = new ArrayList<>();
    private static List<Integer> result = new ArrayList<>();

    public static void main(String[] args) {
        System.out.println("First 25: ");
        abundantOdd(1,100000, 25, false);

        System.out.println("\n\nThousandth: ");
        abundantOdd(1,2500000, 1000, true);

        System.out.println("\n\nFirst over 1bn:"); 
        abundantOdd(1000000001, 2147483647, 1, false);
    }
    private static void abundantOdd(int start, int finish, int listSize, boolean printOne) {
        for (int oddNum = start; oddNum < finish; oddNum += 2) {
            list.clear();
            for (int toDivide = 1; toDivide < oddNum; toDivide+=2) {
                if (oddNum % toDivide == 0)
                    list.add(toDivide);
            }
            if (sumList(list) > oddNum) {
                if(!printOne)
                    System.out.printf("%5d <= %5d \n",oddNum, sumList(list) );
                result.add(oddNum);
            }
            if(printOne && result.size() >= listSize)
                System.out.printf("%5d <= %5d \n",oddNum, sumList(list) );

            if(result.size() >= listSize) break;
        }
    }
    private static int sumList(List list) {
        int sum = 0;
        for (int i = 0; i < list.size(); i++) {
            String temp = list.get(i).toString();
            sum += Integer.parseInt(temp);
        }
        return sum;
    }
}






Fortran: program main
use,intrinsic :: iso_fortran_env, only : int8, int16, int32, int64
implicit none
integer,parameter          :: dp=kind(0.0d0)
character(len=*),parameter :: g='(*(g0,1x))'
integer                    :: j, icount
integer,allocatable        :: list(:)
real(kind=dp)              :: tally

   write(*,*)'N sum'
   icount=0                       
   do j=1,huge(0)-1,2             
      list=divisors(j)            
      tally= sum([real(list,kind=dp)]) 
      if(tally>2*j .and. iand(j,1) /= 0) then 
         icount=icount+1
         select case(icount)  
         case(1:25,1000);write(*,g)icount,':',j
         end select
      endif
      if(icount.gt.1000)exit 
   enddo

   do j=1000000001,huge(0),2
      list=divisors(j)
      tally= sum([real(list,kind=dp)])
      if(tally>2*j .and. iand(j,1) /= 0) then
         write(*,g)'First abundant odd number greater than one billion:',j

         exit
      endif
   enddo

contains

function divisors(num) result (numbers)

integer,intent(in) :: num
integer :: i
integer,allocatable :: numbers(:)
   numbers=[integer :: ]
   do i=1 , int(sqrt(real(num)))
      if (mod(num , i)  .eq. 0) numbers=[numbers, i,num/i]
   enddo
end function divisors

end program main
Task: Abundant odd numbers







Python: 


oddNumber  = 1
aCount  = 0
dSum  = 0
 
from math import sqrt
 
def divisorSum(n):
    sum = 1
    i = int(sqrt(n)+1)
 
    for d in range (2, i):
        if n % d == 0:
            sum += d
            otherD = n // d
            if otherD != d:
                sum += otherD
    return sum
 
print ("The first 25 abundant odd numbers:")
while aCount  < 25:
    dSum  = divisorSum(oddNumber )
    if dSum  > oddNumber :
        aCount  += 1
        print("{0:5} proper divisor sum: {1}". format(oddNumber ,dSum ))
    oddNumber  += 2
 
while aCount  < 1000:
    dSum  = divisorSum(oddNumber )
    if dSum  > oddNumber :
        aCount  += 1
    oddNumber  += 2
print ("\n1000th abundant odd number:")
print ("    ",(oddNumber - 2)," proper divisor sum: ",dSum)
 
oddNumber  = 1000000001
found  = False
while not found :
    dSum  = divisorSum(oddNumber )
    if dSum  > oddNumber :
        found  = True
        print ("\nFirst abundant odd number > 1 000 000 000:")
        print ("    ",oddNumber," proper divisor sum: ",dSum)
    oddNumber  += 2




Fortran: program main
use,intrinsic :: iso_fortran_env, only : int8, int16, int32, int64
implicit none
integer,parameter          :: dp=kind(0.0d0)
character(len=*),parameter :: g='(*(g0,1x))'
integer                    :: j, icount
integer,allocatable        :: list(:)
real(kind=dp)              :: tally

   write(*,*)'N sum'
   icount=0                       
   do j=1,huge(0)-1,2             
      list=divisors(j)            
      tally= sum([real(list,kind=dp)]) 
      if(tally>2*j .and. iand(j,1) /= 0) then 
         icount=icount+1
         select case(icount)  
         case(1:25,1000);write(*,g)icount,':',j
         end select
      endif
      if(icount.gt.1000)exit 
   enddo

   do j=1000000001,huge(0),2
      list=divisors(j)
      tally= sum([real(list,kind=dp)])
      if(tally>2*j .and. iand(j,1) /= 0) then
         write(*,g)'First abundant odd number greater than one billion:',j

         exit
      endif
   enddo

contains

function divisors(num) result (numbers)

integer,intent(in) :: num
integer :: i
integer,allocatable :: numbers(:)
   numbers=[integer :: ]
   do i=1 , int(sqrt(real(num)))
      if (mod(num , i)  .eq. 0) numbers=[numbers, i,num/i]
   enddo
end function divisors

end program main
Task: Abundant odd numbers








VB: Module AbundantOddNumbers
    
    
    

    
    Private Function divisorSum(n As Integer) As Integer
        Dim sum As Integer = 1
        For d As Integer = 2 To Math.Round(Math.Sqrt(n))
            If n Mod d = 0 Then
                sum += d
                Dim otherD As Integer = n \ d
                IF otherD <> d Then
                    sum += otherD
                End If
            End If
        Next d
        Return sum
    End Function

    
    Public Sub Main(args() As String)
        
        Dim oddNumber As Integer = 1
        Dim aCount As Integer = 0
        Dim dSum As Integer = 0
        Console.Out.WriteLine("The first 25 abundant odd numbers:")
        Do While aCount < 25
            dSum = divisorSum(oddNumber)
            If dSum > oddNumber Then
                aCount += 1
                Console.Out.WriteLine(oddNumber.ToString.PadLeft(6) & " proper divisor sum: " & dSum)
            End If
            oddNumber += 2
        Loop
        
        Do While aCount < 1000
            dSum = divisorSum(oddNumber)
            If dSum > oddNumber Then
                aCount += 1
            End If
            oddNumber += 2
        Loop
        Console.Out.WriteLine("1000th abundant odd number:")
        Console.Out.WriteLine("    " & (oddNumber - 2) & " proper divisor sum: " & dSum)
        
        oddNumber = 1000000001
        Dim found As Boolean = False
        Do While Not found
            dSum = divisorSum(oddNumber)
            If dSum > oddNumber Then
                found = True
                Console.Out.WriteLine("First abundant odd number > 1 000 000 000:")
                Console.Out.WriteLine("    " & oddNumber & " proper divisor sum: " & dSum)
            End If
            oddNumber += 2
        Loop
    End Sub
End Module



Fortran: program main
use,intrinsic :: iso_fortran_env, only : int8, int16, int32, int64
implicit none
integer,parameter          :: dp=kind(0.0d0)
character(len=*),parameter :: g='(*(g0,1x))'
integer                    :: j, icount
integer,allocatable        :: list(:)
real(kind=dp)              :: tally

   write(*,*)'N sum'
   icount=0                       
   do j=1,huge(0)-1,2             
      list=divisors(j)            
      tally= sum([real(list,kind=dp)]) 
      if(tally>2*j .and. iand(j,1) /= 0) then 
         icount=icount+1
         select case(icount)  
         case(1:25,1000);write(*,g)icount,':',j
         end select
      endif
      if(icount.gt.1000)exit 
   enddo

   do j=1000000001,huge(0),2
      list=divisors(j)
      tally= sum([real(list,kind=dp)])
      if(tally>2*j .and. iand(j,1) /= 0) then
         write(*,g)'First abundant odd number greater than one billion:',j

         exit
      endif
   enddo

contains

function divisors(num) result (numbers)

integer,intent(in) :: num
integer :: i
integer,allocatable :: numbers(:)
   numbers=[integer :: ]
   do i=1 , int(sqrt(real(num)))
      if (mod(num , i)  .eq. 0) numbers=[numbers, i,num/i]
   enddo
end function divisors

end program main
Task: Jump anywhere



C#: if (x > 0) goto positive;
else goto negative;

positive:
    Console.WriteLine("pos\n"); goto both;

negative:
    Console.WriteLine("neg\n");

both:
    ...









Ada: procedure Goto_Test is
begin

   Stuff;
   goto The_Mother_Ship; 
   Stuff;
   if condition then
      Stuff;
   <<Jail>>
      Stuff;
   end if;
   Stuff;

   
   goto Jail; 
   goto The_Sewer; 
   goto The_Morgue;

   Stuff;
   case condition is
      when Arm1 =>
         Stuff;
         goto The_Gutter; 
         Stuff;
      when Arm2 =>
         Stuff;
      <<The_Gutter>>
         Stuff;
      <<The_Sewer>>
         Stuff;
   end case;

   Stuff;
   for I in Something'Range loop
      Stuff;
   <<The_Morgue>>
      if You_Are_In_Trouble then
         goto The_Mother_Ship;
         
      end if;
      Stuff;
   end loop;

   Stuff;
<<The_Mother_Ship>>
   Stuff;

end Goto_Test;
Task: Jump anywhere

C: 	if (x > 0) goto positive;
	else goto negative;

positive:
	printf("pos\n"); goto both;

negative:
	printf("neg\n");

both:
	...











Ada: procedure Goto_Test is
begin

   Stuff;
   goto The_Mother_Ship; 
   Stuff;
   if condition then
      Stuff;
   <<Jail>>
      Stuff;
   end if;
   Stuff;

   
   goto Jail; 
   goto The_Sewer; 
   goto The_Morgue;

   Stuff;
   case condition is
      when Arm1 =>
         Stuff;
         goto The_Gutter; 
         Stuff;
      when Arm2 =>
         Stuff;
      <<The_Gutter>>
         Stuff;
      <<The_Sewer>>
         Stuff;
   end case;

   Stuff;
   for I in Something'Range loop
      Stuff;
   <<The_Morgue>>
      if You_Are_In_Trouble then
         goto The_Mother_Ship;
         
      end if;
      Stuff;
   end loop;

   Stuff;
<<The_Mother_Ship>>
   Stuff;

end Goto_Test;
Task: Jump anywhere


C++: #include <iostream>
#include <utility>

using namespace std;

int main(void) 
{
    cout << "Find a solution to i = 2 * j - 7\n";
    pair<int, int> answer;
    for(int i = 0; true; i++)
    {
        for(int j = 0; j < i; j++)
        {
            if( i == 2 * j - 7)
            {
                
                answer = make_pair(i, j);
                goto loopexit;
            }
        }
    }
    
loopexit:
    cout << answer.first << " = 2 * " << answer.second << " - 7\n\n"; 
    
    
    
    
    
    

    goto spagetti;
        
    int k;
    k = 9;  
    
    

spagetti:
    
    cout << "k = " << k << "\n";  
    
}










Ada: procedure Goto_Test is
begin

   Stuff;
   goto The_Mother_Ship; 
   Stuff;
   if condition then
      Stuff;
   <<Jail>>
      Stuff;
   end if;
   Stuff;

   
   goto Jail; 
   goto The_Sewer; 
   goto The_Morgue;

   Stuff;
   case condition is
      when Arm1 =>
         Stuff;
         goto The_Gutter; 
         Stuff;
      when Arm2 =>
         Stuff;
      <<The_Gutter>>
         Stuff;
      <<The_Sewer>>
         Stuff;
   end case;

   Stuff;
   for I in Something'Range loop
      Stuff;
   <<The_Morgue>>
      if You_Are_In_Trouble then
         goto The_Mother_Ship;
         
      end if;
      Stuff;
   end loop;

   Stuff;
<<The_Mother_Ship>>
   Stuff;

end Goto_Test;
Task: Jump anywhere




Go: package main

import "fmt"

func main() {
    outer:
    for i := 0; i < 4; i++ {
        for j := 0; j < 4; j++ {
            if i + j == 4 { continue outer }
            if i + j == 5 { break outer }
            fmt.Println(i + j)
        }
    }

    k := 3
    if k == 3 { goto later }
    fmt.Println(k)  
    later:
    k++
    fmt.Println(k)
}








Ada: procedure Goto_Test is
begin

   Stuff;
   goto The_Mother_Ship; 
   Stuff;
   if condition then
      Stuff;
   <<Jail>>
      Stuff;
   end if;
   Stuff;

   
   goto Jail; 
   goto The_Sewer; 
   goto The_Morgue;

   Stuff;
   case condition is
      when Arm1 =>
         Stuff;
         goto The_Gutter; 
         Stuff;
      when Arm2 =>
         Stuff;
      <<The_Gutter>>
         Stuff;
      <<The_Sewer>>
         Stuff;
   end case;

   Stuff;
   for I in Something'Range loop
      Stuff;
   <<The_Morgue>>
      if You_Are_In_Trouble then
         goto The_Mother_Ship;
         
      end if;
      Stuff;
   end loop;

   Stuff;
<<The_Mother_Ship>>
   Stuff;

end Goto_Test;
Task: Jump anywhere





Java: loop1: while (x != 0) {
    loop2: for (int i = 0; i < 10; i++) {
        loop3: do {
            
            if () {
                
                continue loop1;
            }
            
            if () {
                
                break loop2;
            }
        } while (y < 10);
        
    }
    
}







Ada: procedure Goto_Test is
begin

   Stuff;
   goto The_Mother_Ship; 
   Stuff;
   if condition then
      Stuff;
   <<Jail>>
      Stuff;
   end if;
   Stuff;

   
   goto Jail; 
   goto The_Sewer; 
   goto The_Morgue;

   Stuff;
   case condition is
      when Arm1 =>
         Stuff;
         goto The_Gutter; 
         Stuff;
      when Arm2 =>
         Stuff;
      <<The_Gutter>>
         Stuff;
      <<The_Sewer>>
         Stuff;
   end case;

   Stuff;
   for I in Something'Range loop
      Stuff;
   <<The_Morgue>>
      if You_Are_In_Trouble then
         goto The_Mother_Ship;
         
      end if;
      Stuff;
   end loop;

   Stuff;
<<The_Mother_Ship>>
   Stuff;

end Goto_Test;
Task: Jump anywhere







Python: 
from goto import goto, label
label .start
for i in range(1, 4):
    print i
    if i == 2:
        try:
            output = message
        except NameError:
            print "Oops - forgot to define 'message'!  Start again."
            message = "Hello world"
            goto .start
print output, "\n"





Ada: procedure Goto_Test is
begin

   Stuff;
   goto The_Mother_Ship; 
   Stuff;
   if condition then
      Stuff;
   <<Jail>>
      Stuff;
   end if;
   Stuff;

   
   goto Jail; 
   goto The_Sewer; 
   goto The_Morgue;

   Stuff;
   case condition is
      when Arm1 =>
         Stuff;
         goto The_Gutter; 
         Stuff;
      when Arm2 =>
         Stuff;
      <<The_Gutter>>
         Stuff;
      <<The_Sewer>>
         Stuff;
   end case;

   Stuff;
   for I in Something'Range loop
      Stuff;
   <<The_Morgue>>
      if You_Are_In_Trouble then
         goto The_Mother_Ship;
         
      end if;
      Stuff;
   end loop;

   Stuff;
<<The_Mother_Ship>>
   Stuff;

end Goto_Test;
Task: Jump anywhere








VB: Public Sub jump()
    Debug.Print "VBA only allows"
    GoTo 1
    Debug.Print "no global jumps"
1:
    Debug.Print "jumps in procedures with GoTo"
    Debug.Print "However,"
    On 2 GoSub one, two
    Debug.Print "named in the list after 
    Debug.Print "and execution will continue on the next line"
    On 1 GoTo one, two
    Debug.Print "For On Error, see Exceptions"
one:
    Debug.Print "On <n> GoTo let you jump to the n-th label"
    Debug.Print "and won
    Exit Sub
two:
    Debug.Print "On <n> GoSub let you jump to the n-th label": Return
End Sub




Ada: procedure Goto_Test is
begin

   Stuff;
   goto The_Mother_Ship; 
   Stuff;
   if condition then
      Stuff;
   <<Jail>>
      Stuff;
   end if;
   Stuff;

   
   goto Jail; 
   goto The_Sewer; 
   goto The_Morgue;

   Stuff;
   case condition is
      when Arm1 =>
         Stuff;
         goto The_Gutter; 
         Stuff;
      when Arm2 =>
         Stuff;
      <<The_Gutter>>
         Stuff;
      <<The_Sewer>>
         Stuff;
   end case;

   Stuff;
   for I in Something'Range loop
      Stuff;
   <<The_Morgue>>
      if You_Are_In_Trouble then
         goto The_Mother_Ship;
         
      end if;
      Stuff;
   end loop;

   Stuff;
<<The_Mother_Ship>>
   Stuff;

end Goto_Test;
Task: Jump anywhere

C: 	if (x > 0) goto positive;
	else goto negative;

positive:
	printf("pos\n"); goto both;

negative:
	printf("neg\n");

both:
	...
Task: Jump anywhere



C#: if (x > 0) goto positive;
else goto negative;

positive:
    Console.WriteLine("pos\n"); goto both;

negative:
    Console.WriteLine("neg\n");

both:
    ...
Task: Jump anywhere


C++: #include <iostream>
#include <utility>

using namespace std;

int main(void) 
{
    cout << "Find a solution to i = 2 * j - 7\n";
    pair<int, int> answer;
    for(int i = 0; true; i++)
    {
        for(int j = 0; j < i; j++)
        {
            if( i == 2 * j - 7)
            {
                
                answer = make_pair(i, j);
                goto loopexit;
            }
        }
    }
    
loopexit:
    cout << answer.first << " = 2 * " << answer.second << " - 7\n\n"; 
    
    
    
    
    
    

    goto spagetti;
        
    int k;
    k = 9;  
    
    

spagetti:
    
    cout << "k = " << k << "\n";  
    
}
Task: Jump anywhere





Java: loop1: while (x != 0) {
    loop2: for (int i = 0; i < 10; i++) {
        loop3: do {
            
            if () {
                
                continue loop1;
            }
            
            if () {
                
                break loop2;
            }
        } while (y < 10);
        
    }
    
}
Task: Jump anywhere







Python: 
from goto import goto, label
label .start
for i in range(1, 4):
    print i
    if i == 2:
        try:
            output = message
        except NameError:
            print "Oops - forgot to define 'message'!  Start again."
            message = "Hello world"
            goto .start
print output, "\n"
Task: Jump anywhere








VB: Public Sub jump()
    Debug.Print "VBA only allows"
    GoTo 1
    Debug.Print "no global jumps"
1:
    Debug.Print "jumps in procedures with GoTo"
    Debug.Print "However,"
    On 2 GoSub one, two
    Debug.Print "named in the list after 
    Debug.Print "and execution will continue on the next line"
    On 1 GoTo one, two
    Debug.Print "For On Error, see Exceptions"
one:
    Debug.Print "On <n> GoTo let you jump to the n-th label"
    Debug.Print "and won
    Exit Sub
two:
    Debug.Print "On <n> GoSub let you jump to the n-th label": Return
End Sub
Task: Jump anywhere




Go: package main

import "fmt"

func main() {
    outer:
    for i := 0; i < 4; i++ {
        for j := 0; j < 4; j++ {
            if i + j == 4 { continue outer }
            if i + j == 5 { break outer }
            fmt.Println(i + j)
        }
    }

    k := 3
    if k == 3 { goto later }
    fmt.Println(k)  
    later:
    k++
    fmt.Println(k)
}
Task: Jump anywhere

C: 	if (x > 0) goto positive;
	else goto negative;

positive:
	printf("pos\n"); goto both;

negative:
	printf("neg\n");

both:
	...









COBOL: IDENTIFICATION DIVISION.
PROGRAM-ID. JUMPS-PROGRAM.
* Nobody writes like this, of course; but...
PROCEDURE DIVISION.
* You can jump anywhere you like.
START-PARAGRAPH.
    GO TO AN-ARBITRARY-PARAGRAPH.
YET-ANOTHER-PARAGRAPH.
    ALTER START-PARAGRAPH TO PROCEED TO A-PARAGRAPH-SOMEWHERE.
* That's right, folks: we don't just have GO TOs, we have GO TOs whose
* destinations can be changed at will, from anywhere in the program,
* at run time.
    GO TO START-PARAGRAPH.
* But bear in mind: once you get there, the GO TO no longer goes to
* where it says it goes to.
A-PARAGRAPH-SOMEWHERE.
    DISPLAY 'Never heard of him.'
    STOP RUN.
SOME-OTHER-PARAGRAPH.
* You think that's bad? You ain't seen nothing.
    GO TO YET-ANOTHER-PARAGRAPH.
AN-ARBITRARY-PARAGRAPH.
    DISPLAY 'Edsger who now?'
    GO TO SOME-OTHER-PARAGRAPH.
Task: Jump anywhere



C#: if (x > 0) goto positive;
else goto negative;

positive:
    Console.WriteLine("pos\n"); goto both;

negative:
    Console.WriteLine("neg\n");

both:
    ...







COBOL: IDENTIFICATION DIVISION.
PROGRAM-ID. JUMPS-PROGRAM.
* Nobody writes like this, of course; but...
PROCEDURE DIVISION.
* You can jump anywhere you like.
START-PARAGRAPH.
    GO TO AN-ARBITRARY-PARAGRAPH.
YET-ANOTHER-PARAGRAPH.
    ALTER START-PARAGRAPH TO PROCEED TO A-PARAGRAPH-SOMEWHERE.
* That's right, folks: we don't just have GO TOs, we have GO TOs whose
* destinations can be changed at will, from anywhere in the program,
* at run time.
    GO TO START-PARAGRAPH.
* But bear in mind: once you get there, the GO TO no longer goes to
* where it says it goes to.
A-PARAGRAPH-SOMEWHERE.
    DISPLAY 'Never heard of him.'
    STOP RUN.
SOME-OTHER-PARAGRAPH.
* You think that's bad? You ain't seen nothing.
    GO TO YET-ANOTHER-PARAGRAPH.
AN-ARBITRARY-PARAGRAPH.
    DISPLAY 'Edsger who now?'
    GO TO SOME-OTHER-PARAGRAPH.
Task: Jump anywhere


C++: #include <iostream>
#include <utility>

using namespace std;

int main(void) 
{
    cout << "Find a solution to i = 2 * j - 7\n";
    pair<int, int> answer;
    for(int i = 0; true; i++)
    {
        for(int j = 0; j < i; j++)
        {
            if( i == 2 * j - 7)
            {
                
                answer = make_pair(i, j);
                goto loopexit;
            }
        }
    }
    
loopexit:
    cout << answer.first << " = 2 * " << answer.second << " - 7\n\n"; 
    
    
    
    
    
    

    goto spagetti;
        
    int k;
    k = 9;  
    
    

spagetti:
    
    cout << "k = " << k << "\n";  
    
}








COBOL: IDENTIFICATION DIVISION.
PROGRAM-ID. JUMPS-PROGRAM.
* Nobody writes like this, of course; but...
PROCEDURE DIVISION.
* You can jump anywhere you like.
START-PARAGRAPH.
    GO TO AN-ARBITRARY-PARAGRAPH.
YET-ANOTHER-PARAGRAPH.
    ALTER START-PARAGRAPH TO PROCEED TO A-PARAGRAPH-SOMEWHERE.
* That's right, folks: we don't just have GO TOs, we have GO TOs whose
* destinations can be changed at will, from anywhere in the program,
* at run time.
    GO TO START-PARAGRAPH.
* But bear in mind: once you get there, the GO TO no longer goes to
* where it says it goes to.
A-PARAGRAPH-SOMEWHERE.
    DISPLAY 'Never heard of him.'
    STOP RUN.
SOME-OTHER-PARAGRAPH.
* You think that's bad? You ain't seen nothing.
    GO TO YET-ANOTHER-PARAGRAPH.
AN-ARBITRARY-PARAGRAPH.
    DISPLAY 'Edsger who now?'
    GO TO SOME-OTHER-PARAGRAPH.
Task: Jump anywhere





Java: loop1: while (x != 0) {
    loop2: for (int i = 0; i < 10; i++) {
        loop3: do {
            
            if () {
                
                continue loop1;
            }
            
            if () {
                
                break loop2;
            }
        } while (y < 10);
        
    }
    
}





COBOL: IDENTIFICATION DIVISION.
PROGRAM-ID. JUMPS-PROGRAM.
* Nobody writes like this, of course; but...
PROCEDURE DIVISION.
* You can jump anywhere you like.
START-PARAGRAPH.
    GO TO AN-ARBITRARY-PARAGRAPH.
YET-ANOTHER-PARAGRAPH.
    ALTER START-PARAGRAPH TO PROCEED TO A-PARAGRAPH-SOMEWHERE.
* That's right, folks: we don't just have GO TOs, we have GO TOs whose
* destinations can be changed at will, from anywhere in the program,
* at run time.
    GO TO START-PARAGRAPH.
* But bear in mind: once you get there, the GO TO no longer goes to
* where it says it goes to.
A-PARAGRAPH-SOMEWHERE.
    DISPLAY 'Never heard of him.'
    STOP RUN.
SOME-OTHER-PARAGRAPH.
* You think that's bad? You ain't seen nothing.
    GO TO YET-ANOTHER-PARAGRAPH.
AN-ARBITRARY-PARAGRAPH.
    DISPLAY 'Edsger who now?'
    GO TO SOME-OTHER-PARAGRAPH.
Task: Jump anywhere







Python: 
from goto import goto, label
label .start
for i in range(1, 4):
    print i
    if i == 2:
        try:
            output = message
        except NameError:
            print "Oops - forgot to define 'message'!  Start again."
            message = "Hello world"
            goto .start
print output, "\n"



COBOL: IDENTIFICATION DIVISION.
PROGRAM-ID. JUMPS-PROGRAM.
* Nobody writes like this, of course; but...
PROCEDURE DIVISION.
* You can jump anywhere you like.
START-PARAGRAPH.
    GO TO AN-ARBITRARY-PARAGRAPH.
YET-ANOTHER-PARAGRAPH.
    ALTER START-PARAGRAPH TO PROCEED TO A-PARAGRAPH-SOMEWHERE.
* That's right, folks: we don't just have GO TOs, we have GO TOs whose
* destinations can be changed at will, from anywhere in the program,
* at run time.
    GO TO START-PARAGRAPH.
* But bear in mind: once you get there, the GO TO no longer goes to
* where it says it goes to.
A-PARAGRAPH-SOMEWHERE.
    DISPLAY 'Never heard of him.'
    STOP RUN.
SOME-OTHER-PARAGRAPH.
* You think that's bad? You ain't seen nothing.
    GO TO YET-ANOTHER-PARAGRAPH.
AN-ARBITRARY-PARAGRAPH.
    DISPLAY 'Edsger who now?'
    GO TO SOME-OTHER-PARAGRAPH.