Instruction
stringlengths
45
106
input_code
stringlengths
1
13.7k
output_code
stringlengths
1
13.7k
Generate a C# translation of this Groovy snippet without changing its computational steps.
class Point { int x int y Point(int x = 0, int y = 0) { this.x = x; this.y = y } String toString() { "{x:${x}, y:${y}}" } }
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Maintain the same structure and functionality when rewriting this code in C++.
class Point { int x int y Point(int x = 0, int y = 0) { this.x = x; this.y = y } String toString() { "{x:${x}, y:${y}}" } }
struct Point { int x; int y; };
Translate this program into Java but keep the logic exactly as in Groovy.
class Point { int x int y Point(int x = 0, int y = 0) { this.x = x; this.y = y } String toString() { "{x:${x}, y:${y}}" } }
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Transform the following Groovy implementation into Python, maintaining the same output and logic.
class Point { int x int y Point(int x = 0, int y = 0) { this.x = x; this.y = y } String toString() { "{x:${x}, y:${y}}" } }
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Convert this Groovy block to VB, preserving its control flow and logic.
class Point { int x int y Point(int x = 0, int y = 0) { this.x = x; this.y = y } String toString() { "{x:${x}, y:${y}}" } }
Type point x As Integer y As Integer End Type
Maintain the same structure and functionality when rewriting this code in Go.
class Point { int x int y Point(int x = 0, int y = 0) { this.x = x; this.y = y } String toString() { "{x:${x}, y:${y}}" } }
type point struct { x, y float64 }
Can you help me rewrite this code in C# instead of Haskell, keeping it the same logically?
p = (2,3)
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Change the following Haskell code into Java without altering its purpose.
p = (2,3)
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Write the same algorithm in Python as shown in this Haskell implementation.
p = (2,3)
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Rewrite this program in C# while keeping its functionality equivalent to the Icon version.
record Point(x,y)
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Rewrite this program in Java while keeping its functionality equivalent to the Icon version.
record Point(x,y)
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Maintain the same structure and functionality when rewriting this code in Python.
record Point(x,y)
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Transform the following J implementation into C, maintaining the same output and logic.
coclass'Point' create =: 3 : 0 'X Y' =: y ) cocurrent 'base' P =: 10 20 conew 'Point' X__P 10 Y__P 20
typedef struct Point { int x; int y; } Point;
Ensure the translated C# code behaves exactly like the original J snippet.
coclass'Point' create =: 3 : 0 'X Y' =: y ) cocurrent 'base' P =: 10 20 conew 'Point' X__P 10 Y__P 20
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Generate a C++ translation of this J snippet without changing its computational steps.
coclass'Point' create =: 3 : 0 'X Y' =: y ) cocurrent 'base' P =: 10 20 conew 'Point' X__P 10 Y__P 20
struct Point { int x; int y; };
Produce a functionally identical Java code for the snippet given in J.
coclass'Point' create =: 3 : 0 'X Y' =: y ) cocurrent 'base' P =: 10 20 conew 'Point' X__P 10 Y__P 20
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Port the following code from J to Python with equivalent syntax and logic.
coclass'Point' create =: 3 : 0 'X Y' =: y ) cocurrent 'base' P =: 10 20 conew 'Point' X__P 10 Y__P 20
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Write the same code in VB as shown below in J.
coclass'Point' create =: 3 : 0 'X Y' =: y ) cocurrent 'base' P =: 10 20 conew 'Point' X__P 10 Y__P 20
Type point x As Integer y As Integer End Type
Convert this J snippet to Go and keep its semantics consistent.
coclass'Point' create =: 3 : 0 'X Y' =: y ) cocurrent 'base' P =: 10 20 conew 'Point' X__P 10 Y__P 20
type point struct { x, y float64 }
Generate a C translation of this Julia snippet without changing its computational steps.
struct Point{T<:Real} x::T y::T end
typedef struct Point { int x; int y; } Point;
Produce a language-to-language conversion: from Julia to C#, same semantics.
struct Point{T<:Real} x::T y::T end
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Keep all operations the same but rewrite the snippet in Java.
struct Point{T<:Real} x::T y::T end
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Produce a functionally identical Python code for the snippet given in Julia.
struct Point{T<:Real} x::T y::T end
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Keep all operations the same but rewrite the snippet in C.
a = {x = 1; y = 2} b = {x = 3; y = 4} c = { x = a.x + b.x; y = a.y + b.y } print(a.x, a.y) print(c.x, c.y)
typedef struct Point { int x; int y; } Point;
Translate this program into C# but keep the logic exactly as in Lua.
a = {x = 1; y = 2} b = {x = 3; y = 4} c = { x = a.x + b.x; y = a.y + b.y } print(a.x, a.y) print(c.x, c.y)
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Write the same code in C++ as shown below in Lua.
a = {x = 1; y = 2} b = {x = 3; y = 4} c = { x = a.x + b.x; y = a.y + b.y } print(a.x, a.y) print(c.x, c.y)
struct Point { int x; int y; };
Ensure the translated Java code behaves exactly like the original Lua snippet.
a = {x = 1; y = 2} b = {x = 3; y = 4} c = { x = a.x + b.x; y = a.y + b.y } print(a.x, a.y) print(c.x, c.y)
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Convert this Lua snippet to Python and keep its semantics consistent.
a = {x = 1; y = 2} b = {x = 3; y = 4} c = { x = a.x + b.x; y = a.y + b.y } print(a.x, a.y) print(c.x, c.y)
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Port the following code from Lua to VB with equivalent syntax and logic.
a = {x = 1; y = 2} b = {x = 3; y = 4} c = { x = a.x + b.x; y = a.y + b.y } print(a.x, a.y) print(c.x, c.y)
Type point x As Integer y As Integer End Type
Write the same algorithm in Go as shown in this Lua implementation.
a = {x = 1; y = 2} b = {x = 3; y = 4} c = { x = a.x + b.x; y = a.y + b.y } print(a.x, a.y) print(c.x, c.y)
type point struct { x, y float64 }
Translate this program into C but keep the logic exactly as in Mathematica.
In[1]:= a = point[2, 3] Out[1]= point[2, 3] In[2]:= a[[2]] Out[2]= 3 In[3]:= a[[2]] = 4; a Out[3]= point[2, 4]
typedef struct Point { int x; int y; } Point;
Ensure the translated C# code behaves exactly like the original Mathematica snippet.
In[1]:= a = point[2, 3] Out[1]= point[2, 3] In[2]:= a[[2]] Out[2]= 3 In[3]:= a[[2]] = 4; a Out[3]= point[2, 4]
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Write the same algorithm in C++ as shown in this Mathematica implementation.
In[1]:= a = point[2, 3] Out[1]= point[2, 3] In[2]:= a[[2]] Out[2]= 3 In[3]:= a[[2]] = 4; a Out[3]= point[2, 4]
struct Point { int x; int y; };
Change the programming language of this snippet from Mathematica to Java without modifying what it does.
In[1]:= a = point[2, 3] Out[1]= point[2, 3] In[2]:= a[[2]] Out[2]= 3 In[3]:= a[[2]] = 4; a Out[3]= point[2, 4]
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Maintain the same structure and functionality when rewriting this code in Python.
In[1]:= a = point[2, 3] Out[1]= point[2, 3] In[2]:= a[[2]] Out[2]= 3 In[3]:= a[[2]] = 4; a Out[3]= point[2, 4]
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Port the following code from Mathematica to VB with equivalent syntax and logic.
In[1]:= a = point[2, 3] Out[1]= point[2, 3] In[2]:= a[[2]] Out[2]= 3 In[3]:= a[[2]] = 4; a Out[3]= point[2, 4]
Type point x As Integer y As Integer End Type
Write the same code in Go as shown below in Mathematica.
In[1]:= a = point[2, 3] Out[1]= point[2, 3] In[2]:= a[[2]] Out[2]= 3 In[3]:= a[[2]] = 4; a Out[3]= point[2, 4]
type point struct { x, y float64 }
Rewrite the snippet below in C# so it works the same as the original MATLAB code.
point.x=3; point.y=4;
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Change the following MATLAB code into Java without altering its purpose.
point.x=3; point.y=4;
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Maintain the same structure and functionality when rewriting this code in Python.
point.x=3; point.y=4;
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Port the provided Nim code into C while preserving the original functionality.
type Point = tuple[x, y: int] var p: Point = (12, 13) var p2: Point = (x: 100, y: 200)
typedef struct Point { int x; int y; } Point;
Generate an equivalent C# version of this Nim code.
type Point = tuple[x, y: int] var p: Point = (12, 13) var p2: Point = (x: 100, y: 200)
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Convert this Nim block to C++, preserving its control flow and logic.
type Point = tuple[x, y: int] var p: Point = (12, 13) var p2: Point = (x: 100, y: 200)
struct Point { int x; int y; };
Can you help me rewrite this code in Java instead of Nim, keeping it the same logically?
type Point = tuple[x, y: int] var p: Point = (12, 13) var p2: Point = (x: 100, y: 200)
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Translate the given Nim code snippet into Python without altering its behavior.
type Point = tuple[x, y: int] var p: Point = (12, 13) var p2: Point = (x: 100, y: 200)
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Rewrite the snippet below in VB so it works the same as the original Nim code.
type Point = tuple[x, y: int] var p: Point = (12, 13) var p2: Point = (x: 100, y: 200)
Type point x As Integer y As Integer End Type
Change the following Nim code into Go without altering its purpose.
type Point = tuple[x, y: int] var p: Point = (12, 13) var p2: Point = (x: 100, y: 200)
type point struct { x, y float64 }
Ensure the translated C code behaves exactly like the original OCaml snippet.
type tree = Empty | Leaf of int | Node of tree * tree let t1 = Node (Leaf 1, Node (Leaf 2, Leaf 3))
typedef struct Point { int x; int y; } Point;
Keep all operations the same but rewrite the snippet in C#.
type tree = Empty | Leaf of int | Node of tree * tree let t1 = Node (Leaf 1, Node (Leaf 2, Leaf 3))
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Maintain the same structure and functionality when rewriting this code in C++.
type tree = Empty | Leaf of int | Node of tree * tree let t1 = Node (Leaf 1, Node (Leaf 2, Leaf 3))
struct Point { int x; int y; };
Write the same algorithm in Java as shown in this OCaml implementation.
type tree = Empty | Leaf of int | Node of tree * tree let t1 = Node (Leaf 1, Node (Leaf 2, Leaf 3))
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Convert the following code from OCaml to Python, ensuring the logic remains intact.
type tree = Empty | Leaf of int | Node of tree * tree let t1 = Node (Leaf 1, Node (Leaf 2, Leaf 3))
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Convert the following code from OCaml to VB, ensuring the logic remains intact.
type tree = Empty | Leaf of int | Node of tree * tree let t1 = Node (Leaf 1, Node (Leaf 2, Leaf 3))
Type point x As Integer y As Integer End Type
Generate an equivalent Go version of this OCaml code.
type tree = Empty | Leaf of int | Node of tree * tree let t1 = Node (Leaf 1, Node (Leaf 2, Leaf 3))
type point struct { x, y float64 }
Transform the following Pascal implementation into C#, maintaining the same output and logic.
type point = record x, y: integer; end;
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Change the programming language of this snippet from Pascal to Java without modifying what it does.
type point = record x, y: integer; end;
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Port the following code from Pascal to Python with equivalent syntax and logic.
type point = record x, y: integer; end;
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Write the same code in C# as shown below in Perl.
my @point = (3, 8);
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Write the same algorithm in Java as shown in this Perl implementation.
my @point = (3, 8);
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Produce a language-to-language conversion: from Perl to Python, same semantics.
my @point = (3, 8);
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Change the following PowerShell code into C without altering its purpose.
class Point { [Int]$a [Int]$b Point() { $this.a = 0 $this.b = 0 } Point([Int]$a, [Int]$b) { $this.a = $a $this.b = $b } [Int]add() {return $this.a + $this.b} [Int]mul() {return $this.a * $this.b} } $p1 = [Point]::new() $p2 = [Point]::new(3,2) $p1.add() $p2.mul()
typedef struct Point { int x; int y; } Point;
Preserve the algorithm and functionality while converting the code from PowerShell to C#.
class Point { [Int]$a [Int]$b Point() { $this.a = 0 $this.b = 0 } Point([Int]$a, [Int]$b) { $this.a = $a $this.b = $b } [Int]add() {return $this.a + $this.b} [Int]mul() {return $this.a * $this.b} } $p1 = [Point]::new() $p2 = [Point]::new(3,2) $p1.add() $p2.mul()
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Ensure the translated C++ code behaves exactly like the original PowerShell snippet.
class Point { [Int]$a [Int]$b Point() { $this.a = 0 $this.b = 0 } Point([Int]$a, [Int]$b) { $this.a = $a $this.b = $b } [Int]add() {return $this.a + $this.b} [Int]mul() {return $this.a * $this.b} } $p1 = [Point]::new() $p2 = [Point]::new(3,2) $p1.add() $p2.mul()
struct Point { int x; int y; };
Change the programming language of this snippet from PowerShell to Java without modifying what it does.
class Point { [Int]$a [Int]$b Point() { $this.a = 0 $this.b = 0 } Point([Int]$a, [Int]$b) { $this.a = $a $this.b = $b } [Int]add() {return $this.a + $this.b} [Int]mul() {return $this.a * $this.b} } $p1 = [Point]::new() $p2 = [Point]::new(3,2) $p1.add() $p2.mul()
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Write a version of this PowerShell function in Python with identical behavior.
class Point { [Int]$a [Int]$b Point() { $this.a = 0 $this.b = 0 } Point([Int]$a, [Int]$b) { $this.a = $a $this.b = $b } [Int]add() {return $this.a + $this.b} [Int]mul() {return $this.a * $this.b} } $p1 = [Point]::new() $p2 = [Point]::new(3,2) $p1.add() $p2.mul()
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Preserve the algorithm and functionality while converting the code from PowerShell to VB.
class Point { [Int]$a [Int]$b Point() { $this.a = 0 $this.b = 0 } Point([Int]$a, [Int]$b) { $this.a = $a $this.b = $b } [Int]add() {return $this.a + $this.b} [Int]mul() {return $this.a * $this.b} } $p1 = [Point]::new() $p2 = [Point]::new(3,2) $p1.add() $p2.mul()
Type point x As Integer y As Integer End Type
Translate this program into Go but keep the logic exactly as in PowerShell.
class Point { [Int]$a [Int]$b Point() { $this.a = 0 $this.b = 0 } Point([Int]$a, [Int]$b) { $this.a = $a $this.b = $b } [Int]add() {return $this.a + $this.b} [Int]mul() {return $this.a * $this.b} } $p1 = [Point]::new() $p2 = [Point]::new(3,2) $p1.add() $p2.mul()
type point struct { x, y float64 }
Generate an equivalent C version of this R code.
mypoint <- list(x=3.4, y=6.7) mypoint$x list(a=1:10, b="abc", c=runif(10), d=list(e=1L, f=TRUE))
typedef struct Point { int x; int y; } Point;
Write a version of this R function in C# with identical behavior.
mypoint <- list(x=3.4, y=6.7) mypoint$x list(a=1:10, b="abc", c=runif(10), d=list(e=1L, f=TRUE))
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Produce a functionally identical C++ code for the snippet given in R.
mypoint <- list(x=3.4, y=6.7) mypoint$x list(a=1:10, b="abc", c=runif(10), d=list(e=1L, f=TRUE))
struct Point { int x; int y; };
Write the same algorithm in Java as shown in this R implementation.
mypoint <- list(x=3.4, y=6.7) mypoint$x list(a=1:10, b="abc", c=runif(10), d=list(e=1L, f=TRUE))
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Port the following code from R to Python with equivalent syntax and logic.
mypoint <- list(x=3.4, y=6.7) mypoint$x list(a=1:10, b="abc", c=runif(10), d=list(e=1L, f=TRUE))
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Change the following R code into VB without altering its purpose.
mypoint <- list(x=3.4, y=6.7) mypoint$x list(a=1:10, b="abc", c=runif(10), d=list(e=1L, f=TRUE))
Type point x As Integer y As Integer End Type
Rewrite the snippet below in Go so it works the same as the original R code.
mypoint <- list(x=3.4, y=6.7) mypoint$x list(a=1:10, b="abc", c=runif(10), d=list(e=1L, f=TRUE))
type point struct { x, y float64 }
Convert this Racket block to C#, preserving its control flow and logic.
#lang racket (struct point (x y))
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Port the following code from Racket to Java with equivalent syntax and logic.
#lang racket (struct point (x y))
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Preserve the algorithm and functionality while converting the code from Racket to Python.
#lang racket (struct point (x y))
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Port the provided COBOL code into C while preserving the original functionality.
01 Point. 05 x pic 9(3). 05 y pic 9(3).
typedef struct Point { int x; int y; } Point;
Keep all operations the same but rewrite the snippet in C#.
01 Point. 05 x pic 9(3). 05 y pic 9(3).
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Rewrite the snippet below in C++ so it works the same as the original COBOL code.
01 Point. 05 x pic 9(3). 05 y pic 9(3).
struct Point { int x; int y; };
Ensure the translated Java code behaves exactly like the original COBOL snippet.
01 Point. 05 x pic 9(3). 05 y pic 9(3).
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Port the following code from COBOL to Python with equivalent syntax and logic.
01 Point. 05 x pic 9(3). 05 y pic 9(3).
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Generate a VB translation of this COBOL snippet without changing its computational steps.
01 Point. 05 x pic 9(3). 05 y pic 9(3).
Type point x As Integer y As Integer End Type
Maintain the same structure and functionality when rewriting this code in C.
options replace format comments java crossref symbols nobinary class RCompoundDataType method main(args = String[]) public static pp = Point(2, 4) say pp return class RCompoundDataType.Point -- inner class "Point" properties indirect -- have NetRexx create getters & setters x = Integer y = In...
typedef struct Point { int x; int y; } Point;
Change the programming language of this snippet from REXX to C# without modifying what it does.
options replace format comments java crossref symbols nobinary class RCompoundDataType method main(args = String[]) public static pp = Point(2, 4) say pp return class RCompoundDataType.Point -- inner class "Point" properties indirect -- have NetRexx create getters & setters x = Integer y = In...
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Change the programming language of this snippet from REXX to C++ without modifying what it does.
options replace format comments java crossref symbols nobinary class RCompoundDataType method main(args = String[]) public static pp = Point(2, 4) say pp return class RCompoundDataType.Point -- inner class "Point" properties indirect -- have NetRexx create getters & setters x = Integer y = In...
struct Point { int x; int y; };
Port the provided REXX code into Java while preserving the original functionality.
options replace format comments java crossref symbols nobinary class RCompoundDataType method main(args = String[]) public static pp = Point(2, 4) say pp return class RCompoundDataType.Point -- inner class "Point" properties indirect -- have NetRexx create getters & setters x = Integer y = In...
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Convert this REXX snippet to Python and keep its semantics consistent.
options replace format comments java crossref symbols nobinary class RCompoundDataType method main(args = String[]) public static pp = Point(2, 4) say pp return class RCompoundDataType.Point -- inner class "Point" properties indirect -- have NetRexx create getters & setters x = Integer y = In...
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Produce a functionally identical VB code for the snippet given in REXX.
options replace format comments java crossref symbols nobinary class RCompoundDataType method main(args = String[]) public static pp = Point(2, 4) say pp return class RCompoundDataType.Point -- inner class "Point" properties indirect -- have NetRexx create getters & setters x = Integer y = In...
Type point x As Integer y As Integer End Type
Translate the given REXX code snippet into Go without altering its behavior.
options replace format comments java crossref symbols nobinary class RCompoundDataType method main(args = String[]) public static pp = Point(2, 4) say pp return class RCompoundDataType.Point -- inner class "Point" properties indirect -- have NetRexx create getters & setters x = Integer y = In...
type point struct { x, y float64 }
Produce a functionally identical C code for the snippet given in Ruby.
struct Point(T) getter x : T getter y : T def initialize(@x, @y) end end puts Point(Int32).new 13, 12
typedef struct Point { int x; int y; } Point;
Can you help me rewrite this code in C# instead of Ruby, keeping it the same logically?
struct Point(T) getter x : T getter y : T def initialize(@x, @y) end end puts Point(Int32).new 13, 12
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Port the provided Ruby code into C++ while preserving the original functionality.
struct Point(T) getter x : T getter y : T def initialize(@x, @y) end end puts Point(Int32).new 13, 12
struct Point { int x; int y; };
Ensure the translated Java code behaves exactly like the original Ruby snippet.
struct Point(T) getter x : T getter y : T def initialize(@x, @y) end end puts Point(Int32).new 13, 12
public class Point { public int x, y; public Point() { this(0); } public Point(int x0) { this(x0,0); } public Point(int x0, int y0) { x = x0; y = y0; } public static void main(String args[]) { Point point = new Point(1,2); System.out.println("x = " + point.x ); System.out.println("y = " + point...
Write a version of this Ruby function in Python with identical behavior.
struct Point(T) getter x : T getter y : T def initialize(@x, @y) end end puts Point(Int32).new 13, 12
X, Y = 0, 1 p = (3, 4) p = [3, 4] print p[X]
Convert this Ruby block to VB, preserving its control flow and logic.
struct Point(T) getter x : T getter y : T def initialize(@x, @y) end end puts Point(Int32).new 13, 12
Type point x As Integer y As Integer End Type
Change the following Ruby code into Go without altering its purpose.
struct Point(T) getter x : T getter y : T def initialize(@x, @y) end end puts Point(Int32).new 13, 12
type point struct { x, y float64 }
Produce a functionally identical C code for the snippet given in Scala.
data class Point(var x: Int, var y: Int) fun main(args: Array<String>) { val p = Point(1, 2) println(p) p.x = 3 p.y = 4 println(p) }
typedef struct Point { int x; int y; } Point;
Write the same algorithm in C# as shown in this Scala implementation.
data class Point(var x: Int, var y: Int) fun main(args: Array<String>) { val p = Point(1, 2) println(p) p.x = 3 p.y = 4 println(p) }
struct Point { public int x, y; public Point(int x, int y) { this.x = x; this.y = y; } }
Convert this Scala block to C++, preserving its control flow and logic.
data class Point(var x: Int, var y: Int) fun main(args: Array<String>) { val p = Point(1, 2) println(p) p.x = 3 p.y = 4 println(p) }
struct Point { int x; int y; };