WeixiangYan/CodeTransOcean huggingface dataset:
Task: Determine if a string is numeric

C: #include <ctype.h>
#include <stdlib.h>
int isNumeric (const char * s)
{
    if (s == NULL || *s == '\0' || isspace(*s))
      return 0;
    char * p;
    strtod (s, &p);
    return *p == '\0';
}







Python: def is_numeric(s):
    try:
        float(s)
        return True
    except (ValueError, TypeError):
        return False

is_numeric('123.0')
Task: Determine if a string is numeric

C: #include <ctype.h>
#include <stdlib.h>
int isNumeric (const char * s)
{
    if (s == NULL || *s == '\0' || isspace(*s))
      return 0;
    char * p;
    strtod (s, &p);
    return *p == '\0';
}








VB: Sub Main()
    Debug.Print Is_Numeric("")
    Debug.Print Is_Numeric("-5.32")
    Debug.Print Is_Numeric("-51,321 32")
    Debug.Print Is_Numeric("123.4")
    Debug.Print Is_Numeric("123,4")
    Debug.Print Is_Numeric("123;4")
    Debug.Print Is_Numeric("123.4x")
End Sub

Private Function Is_Numeric(s As String) As Boolean
Dim Separat As String, Other As String
    Separat = Application.DecimalSeparator
    Other = IIf(Separat = ",", ".", ",")
    Is_Numeric = IsNumeric(Replace(s, Other, Separat))
End Function
Task: Determine if a string is numeric


C++: #include <sstream> 

using namespace std;

bool isNumeric( const char* pszInput, int nNumberBase )
{
	istringstream iss( pszInput );

	if ( nNumberBase == 10 )
	{
		double dTestSink;
		iss >> dTestSink;
	}
	else if ( nNumberBase == 8 || nNumberBase == 16 )
	{
		int nTestSink;
		iss >> ( ( nNumberBase == 8 ) ? oct : hex ) >> nTestSink;
	}
	else
		return false;

	
	if ( ! iss )
		return false;

	
	return ( iss.rdbuf()->in_avail() == 0 );
}


C#: public static bool IsNumeric(string s)
{
    double Result;
    return double.TryParse(s, out Result);  
}        

string value = "123";
if (IsNumeric(value)) 
{
  
}
Task: Determine if a string is numeric


C++: #include <sstream> 

using namespace std;

bool isNumeric( const char* pszInput, int nNumberBase )
{
	istringstream iss( pszInput );

	if ( nNumberBase == 10 )
	{
		double dTestSink;
		iss >> dTestSink;
	}
	else if ( nNumberBase == 8 || nNumberBase == 16 )
	{
		int nTestSink;
		iss >> ( ( nNumberBase == 8 ) ? oct : hex ) >> nTestSink;
	}
	else
		return false;

	
	if ( ! iss )
		return false;

	
	return ( iss.rdbuf()->in_avail() == 0 );
}



Go: package main

import (
    "fmt"
    "strconv"
)

func isNumeric(s string) bool {
    _, err := strconv.ParseFloat(s, 64)
    return err == nil
}

func main() {
    fmt.Println("Are these strings numeric?")
    strings := []string{"1", "3.14", "-100", "1e2", "NaN", "rose"}
    for _, s := range strings {
        fmt.Printf("  %4s -> %t\n", s, isNumeric(s))
    }
}
Task: Determine if a string is numeric


C++: #include <sstream> 

using namespace std;

bool isNumeric( const char* pszInput, int nNumberBase )
{
	istringstream iss( pszInput );

	if ( nNumberBase == 10 )
	{
		double dTestSink;
		iss >> dTestSink;
	}
	else if ( nNumberBase == 8 || nNumberBase == 16 )
	{
		int nTestSink;
		iss >> ( ( nNumberBase == 8 ) ? oct : hex ) >> nTestSink;
	}
	else
		return false;

	
	if ( ! iss )
		return false;

	
	return ( iss.rdbuf()->in_avail() == 0 );
}






Python: def is_numeric(s):
    try:
        float(s)
        return True
    except (ValueError, TypeError):
        return False

is_numeric('123.0')
Task: Determine if a string is numeric


C++: #include <sstream> 

using namespace std;

bool isNumeric( const char* pszInput, int nNumberBase )
{
	istringstream iss( pszInput );

	if ( nNumberBase == 10 )
	{
		double dTestSink;
		iss >> dTestSink;
	}
	else if ( nNumberBase == 8 || nNumberBase == 16 )
	{
		int nTestSink;
		iss >> ( ( nNumberBase == 8 ) ? oct : hex ) >> nTestSink;
	}
	else
		return false;

	
	if ( ! iss )
		return false;

	
	return ( iss.rdbuf()->in_avail() == 0 );
}







VB: Sub Main()
    Debug.Print Is_Numeric("")
    Debug.Print Is_Numeric("-5.32")
    Debug.Print Is_Numeric("-51,321 32")
    Debug.Print Is_Numeric("123.4")
    Debug.Print Is_Numeric("123,4")
    Debug.Print Is_Numeric("123;4")
    Debug.Print Is_Numeric("123.4x")
End Sub

Private Function Is_Numeric(s As String) As Boolean
Dim Separat As String, Other As String
    Separat = Application.DecimalSeparator
    Other = IIf(Separat = ",", ".", ",")
    Is_Numeric = IsNumeric(Replace(s, Other, Separat))
End Function
Task: Determine if a string is numeric



C#: public static bool IsNumeric(string s)
{
    double Result;
    return double.TryParse(s, out Result);  
}        

string value = "123";
if (IsNumeric(value)) 
{
  
}


Go: package main

import (
    "fmt"
    "strconv"
)

func isNumeric(s string) bool {
    _, err := strconv.ParseFloat(s, 64)
    return err == nil
}

func main() {
    fmt.Println("Are these strings numeric?")
    strings := []string{"1", "3.14", "-100", "1e2", "NaN", "rose"}
    for _, s := range strings {
        fmt.Printf("  %4s -> %t\n", s, isNumeric(s))
    }
}
Task: Determine if a string is numeric



C#: public static bool IsNumeric(string s)
{
    double Result;
    return double.TryParse(s, out Result);  
}        

string value = "123";
if (IsNumeric(value)) 
{
  
}





Python: def is_numeric(s):
    try:
        float(s)
        return True
    except (ValueError, TypeError):
        return False

is_numeric('123.0')
Task: Determine if a string is numeric




Go: package main

import (
    "fmt"
    "strconv"
)

func isNumeric(s string) bool {
    _, err := strconv.ParseFloat(s, 64)
    return err == nil
}

func main() {
    fmt.Println("Are these strings numeric?")
    strings := []string{"1", "3.14", "-100", "1e2", "NaN", "rose"}
    for _, s := range strings {
        fmt.Printf("  %4s -> %t\n", s, isNumeric(s))
    }
}


Java: public boolean isNumeric(String input) {
  try {
    Integer.parseInt(input);
    return true;
  }
  catch (NumberFormatException e) {
    
    return false;
  }
}
Task: Determine if a string is numeric





Java: public boolean isNumeric(String input) {
  try {
    Integer.parseInt(input);
    return true;
  }
  catch (NumberFormatException e) {
    
    return false;
  }
}



Python: def is_numeric(s):
    try:
        float(s)
        return True
    except (ValueError, TypeError):
        return False

is_numeric('123.0')
Task: Determine if a string is numeric





Java: public boolean isNumeric(String input) {
  try {
    Integer.parseInt(input);
    return true;
  }
  catch (NumberFormatException e) {
    
    return false;
  }
}




VB: Sub Main()
    Debug.Print Is_Numeric("")
    Debug.Print Is_Numeric("-5.32")
    Debug.Print Is_Numeric("-51,321 32")
    Debug.Print Is_Numeric("123.4")
    Debug.Print Is_Numeric("123,4")
    Debug.Print Is_Numeric("123;4")
    Debug.Print Is_Numeric("123.4x")
End Sub

Private Function Is_Numeric(s As String) As Boolean
Dim Separat As String, Other As String
    Separat = Application.DecimalSeparator
    Other = IIf(Separat = ",", ".", ",")
    Is_Numeric = IsNumeric(Replace(s, Other, Separat))
End Function
Task: Determine if a string is numeric




Go: package main

import (
    "fmt"
    "strconv"
)

func isNumeric(s string) bool {
    _, err := strconv.ParseFloat(s, 64)
    return err == nil
}

func main() {
    fmt.Println("Are these strings numeric?")
    strings := []string{"1", "3.14", "-100", "1e2", "NaN", "rose"}
    for _, s := range strings {
        fmt.Printf("  %4s -> %t\n", s, isNumeric(s))
    }
}




Python: def is_numeric(s):
    try:
        float(s)
        return True
    except (ValueError, TypeError):
        return False

is_numeric('123.0')
Task: Determine if a string is numeric




Go: package main

import (
    "fmt"
    "strconv"
)

func isNumeric(s string) bool {
    _, err := strconv.ParseFloat(s, 64)
    return err == nil
}

func main() {
    fmt.Println("Are these strings numeric?")
    strings := []string{"1", "3.14", "-100", "1e2", "NaN", "rose"}
    for _, s := range strings {
        fmt.Printf("  %4s -> %t\n", s, isNumeric(s))
    }
}





VB: Sub Main()
    Debug.Print Is_Numeric("")
    Debug.Print Is_Numeric("-5.32")
    Debug.Print Is_Numeric("-51,321 32")
    Debug.Print Is_Numeric("123.4")
    Debug.Print Is_Numeric("123,4")
    Debug.Print Is_Numeric("123;4")
    Debug.Print Is_Numeric("123.4x")
End Sub

Private Function Is_Numeric(s As String) As Boolean
Dim Separat As String, Other As String
    Separat = Application.DecimalSeparator
    Other = IIf(Separat = ",", ".", ",")
    Is_Numeric = IsNumeric(Replace(s, Other, Separat))
End Function
Task: Determine if a string is numeric



C#: public static bool IsNumeric(string s)
{
    double Result;
    return double.TryParse(s, out Result);  
}        

string value = "123";
if (IsNumeric(value)) 
{
  
}



Java: public boolean isNumeric(String input) {
  try {
    Integer.parseInt(input);
    return true;
  }
  catch (NumberFormatException e) {
    
    return false;
  }
}
Task: Determine if a string is numeric







Python: def is_numeric(s):
    try:
        float(s)
        return True
    except (ValueError, TypeError):
        return False

is_numeric('123.0')


VB: Sub Main()
    Debug.Print Is_Numeric("")
    Debug.Print Is_Numeric("-5.32")
    Debug.Print Is_Numeric("-51,321 32")
    Debug.Print Is_Numeric("123.4")
    Debug.Print Is_Numeric("123,4")
    Debug.Print Is_Numeric("123;4")
    Debug.Print Is_Numeric("123.4x")
End Sub

Private Function Is_Numeric(s As String) As Boolean
Dim Separat As String, Other As String
    Separat = Application.DecimalSeparator
    Other = IIf(Separat = ",", ".", ",")
    Is_Numeric = IsNumeric(Replace(s, Other, Separat))
End Function
Task: Determine if a string is numeric


C++: #include <sstream> 

using namespace std;

bool isNumeric( const char* pszInput, int nNumberBase )
{
	istringstream iss( pszInput );

	if ( nNumberBase == 10 )
	{
		double dTestSink;
		iss >> dTestSink;
	}
	else if ( nNumberBase == 8 || nNumberBase == 16 )
	{
		int nTestSink;
		iss >> ( ( nNumberBase == 8 ) ? oct : hex ) >> nTestSink;
	}
	else
		return false;

	
	if ( ! iss )
		return false;

	
	return ( iss.rdbuf()->in_avail() == 0 );
}




Java: public boolean isNumeric(String input) {
  try {
    Integer.parseInt(input);
    return true;
  }
  catch (NumberFormatException e) {
    
    return false;
  }
}
Task: Determine if a string is numeric



C#: public static bool IsNumeric(string s)
{
    double Result;
    return double.TryParse(s, out Result);  
}        

string value = "123";
if (IsNumeric(value)) 
{
  
}






VB: Sub Main()
    Debug.Print Is_Numeric("")
    Debug.Print Is_Numeric("-5.32")
    Debug.Print Is_Numeric("-51,321 32")
    Debug.Print Is_Numeric("123.4")
    Debug.Print Is_Numeric("123,4")
    Debug.Print Is_Numeric("123;4")
    Debug.Print Is_Numeric("123.4x")
End Sub

Private Function Is_Numeric(s As String) As Boolean
Dim Separat As String, Other As String
    Separat = Application.DecimalSeparator
    Other = IIf(Separat = ",", ".", ",")
    Is_Numeric = IsNumeric(Replace(s, Other, Separat))
End Function
Task: Determine if a string is numeric

C: #include <ctype.h>
#include <stdlib.h>
int isNumeric (const char * s)
{
    if (s == NULL || *s == '\0' || isspace(*s))
      return 0;
    char * p;
    strtod (s, &p);
    return *p == '\0';
}






PHP: <?php
$string = '123';
if(is_numeric(trim($string))) {
}
?>
Task: Determine if a string is numeric



C#: public static bool IsNumeric(string s)
{
    double Result;
    return double.TryParse(s, out Result);  
}        

string value = "123";
if (IsNumeric(value)) 
{
  
}




PHP: <?php
$string = '123';
if(is_numeric(trim($string))) {
}
?>
Task: Determine if a string is numeric


C++: #include <sstream> 

using namespace std;

bool isNumeric( const char* pszInput, int nNumberBase )
{
	istringstream iss( pszInput );

	if ( nNumberBase == 10 )
	{
		double dTestSink;
		iss >> dTestSink;
	}
	else if ( nNumberBase == 8 || nNumberBase == 16 )
	{
		int nTestSink;
		iss >> ( ( nNumberBase == 8 ) ? oct : hex ) >> nTestSink;
	}
	else
		return false;

	
	if ( ! iss )
		return false;

	
	return ( iss.rdbuf()->in_avail() == 0 );
}





PHP: <?php
$string = '123';
if(is_numeric(trim($string))) {
}
?>
Task: Determine if a string is numeric




Go: package main

import (
    "fmt"
    "strconv"
)

func isNumeric(s string) bool {
    _, err := strconv.ParseFloat(s, 64)
    return err == nil
}

func main() {
    fmt.Println("Are these strings numeric?")
    strings := []string{"1", "3.14", "-100", "1e2", "NaN", "rose"}
    for _, s := range strings {
        fmt.Printf("  %4s -> %t\n", s, isNumeric(s))
    }
}



PHP: <?php
$string = '123';
if(is_numeric(trim($string))) {
}
?>
Task: Determine if a string is numeric





Java: public boolean isNumeric(String input) {
  try {
    Integer.parseInt(input);
    return true;
  }
  catch (NumberFormatException e) {
    
    return false;
  }
}


PHP: <?php
$string = '123';
if(is_numeric(trim($string))) {
}
?>
Task: Determine if a string is numeric






PHP: <?php
$string = '123';
if(is_numeric(trim($string))) {
}
?>


Python: def is_numeric(s):
    try:
        float(s)
        return True
    except (ValueError, TypeError):
        return False

is_numeric('123.0')
Task: Determine if a string is numeric






PHP: <?php
$string = '123';
if(is_numeric(trim($string))) {
}
?>



VB: Sub Main()
    Debug.Print Is_Numeric("")
    Debug.Print Is_Numeric("-5.32")
    Debug.Print Is_Numeric("-51,321 32")
    Debug.Print Is_Numeric("123.4")
    Debug.Print Is_Numeric("123,4")
    Debug.Print Is_Numeric("123;4")
    Debug.Print Is_Numeric("123.4x")
End Sub

Private Function Is_Numeric(s As String) As Boolean
Dim Separat As String, Other As String
    Separat = Application.DecimalSeparator
    Other = IIf(Separat = ",", ".", ",")
    Is_Numeric = IsNumeric(Replace(s, Other, Separat))
End Function
Task: Polyspiral

C: #include<graphics.h>
#include<math.h>

#define factor M_PI/180
#define LAG 1000

void polySpiral(int windowWidth,int	windowHeight){
	int incr = 0, angle, i, length;
	double x,y,x1,y1;
	
	while(1){
		incr = (incr + 5)%360; 
		
		x = windowWidth/2;
		y = windowHeight/2;
		
		length = 5;
		angle = incr;
		
		for(i=1;i<=150;i++){
			x1 = x + length*cos(factor*angle);
			y1 = y + length*sin(factor*angle);
			line(x,y,x1,y1);
			
			length += 3;
			
			angle = (angle + incr)%360;
			
			x = x1;
			y = y1;
		}
		delay(LAG);
		cleardevice();	
	}
}	

int main()
{
	initwindow(500,500,"Polyspiral");
	
	polySpiral(500,500);
	
	closegraph();
	
	return 0;
}



C#: using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.Windows.Threading;

namespace Polyspiral
{
    public partial class Form1 : Form
    {
        private double inc;

        public Form1()
        {
            Width = Height = 640;
            StartPosition = FormStartPosition.CenterScreen;
            SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.UserPaint |
                ControlStyles.DoubleBuffer,
                true);

            var timer = new DispatcherTimer();
            timer.Tick += (s, e) => { inc = (inc + 0.05) % 360; Refresh(); };
            timer.Interval = new TimeSpan(0, 0, 0, 0, 40);
            timer.Start();
        }

        private void DrawSpiral(Graphics g, int len, double angleIncrement)
        {
            double x1 = Width / 2;
            double y1 = Height / 2;
            double angle = angleIncrement;

            for (int i = 0; i < 150; i++)
            {
                double x2 = x1 + Math.Cos(angle) * len;
                double y2 = y1 - Math.Sin(angle) * len;
                g.DrawLine(Pens.Blue, (int)x1, (int)y1, (int)x2, (int)y2);
                x1 = x2;
                y1 = y2;

                len += 3;

                angle = (angle + angleIncrement) % (Math.PI * 2);
            }
        }

        protected override void OnPaint(PaintEventArgs args)
        {
            var g = args.Graphics;
            g.SmoothingMode = SmoothingMode.AntiAlias;
            g.Clear(Color.White);

            DrawSpiral(g, 5, ToRadians(inc));
        }

        private double ToRadians(double angle)
        {
            return Math.PI * angle / 180.0;
        }
    }
}
Task: Polyspiral

C: #include<graphics.h>
#include<math.h>

#define factor M_PI/180
#define LAG 1000

void polySpiral(int windowWidth,int	windowHeight){
	int incr = 0, angle, i, length;
	double x,y,x1,y1;
	
	while(1){
		incr = (incr + 5)%360; 
		
		x = windowWidth/2;
		y = windowHeight/2;
		
		length = 5;
		angle = incr;
		
		for(i=1;i<=150;i++){
			x1 = x + length*cos(factor*angle);
			y1 = y + length*sin(factor*angle);
			line(x,y,x1,y1);
			
			length += 3;
			
			angle = (angle + incr)%360;
			
			x = x1;
			y = y1;
		}
		delay(LAG);
		cleardevice();	
	}
}	

int main()
{
	initwindow(500,500,"Polyspiral");
	
	polySpiral(500,500);
	
	closegraph();
	
	return 0;
}





Java: import java.awt.*;
import java.awt.event.ActionEvent;
import javax.swing.*;

public class PolySpiral extends JPanel {
    double inc = 0;

    public PolySpiral() {
        setPreferredSize(new Dimension(640, 640));
        setBackground(Color.white);

        new Timer(40, (ActionEvent e) -> {
            inc = (inc + 0.05) % 360;
            repaint();
        }).start();
    }

    void drawSpiral(Graphics2D g, int len, double angleIncrement) {

        double x1 = getWidth() / 2;
        double y1 = getHeight() / 2;
        double angle = angleIncrement;

        for (int i = 0; i < 150; i++) {

            g.setColor(Color.getHSBColor(i / 150f, 1.0f, 1.0f));

            double x2 = x1 + Math.cos(angle) * len;
            double y2 = y1 - Math.sin(angle) * len;
            g.drawLine((int) x1, (int) y1, (int) x2, (int) y2);
            x1 = x2;
            y1 = y2;

            len += 3;

            angle = (angle + angleIncrement) % (Math.PI * 2);
        }
    }

    @Override
    public void paintComponent(Graphics gg) {
        super.paintComponent(gg);
        Graphics2D g = (Graphics2D) gg;
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);

        drawSpiral(g, 5, Math.toRadians(inc));
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setTitle("PolySpiral");
            f.setResizable(true);
            f.add(new PolySpiral(), BorderLayout.CENTER);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
        });
    }
}
Task: Polyspiral

C: #include<graphics.h>
#include<math.h>

#define factor M_PI/180
#define LAG 1000

void polySpiral(int windowWidth,int	windowHeight){
	int incr = 0, angle, i, length;
	double x,y,x1,y1;
	
	while(1){
		incr = (incr + 5)%360; 
		
		x = windowWidth/2;
		y = windowHeight/2;
		
		length = 5;
		angle = incr;
		
		for(i=1;i<=150;i++){
			x1 = x + length*cos(factor*angle);
			y1 = y + length*sin(factor*angle);
			line(x,y,x1,y1);
			
			length += 3;
			
			angle = (angle + incr)%360;
			
			x = x1;
			y = y1;
		}
		delay(LAG);
		cleardevice();	
	}
}	

int main()
{
	initwindow(500,500,"Polyspiral");
	
	polySpiral(500,500);
	
	closegraph();
	
	return 0;
}







Python: import math

import pygame
from pygame.locals import *

pygame.init()
screen = pygame.display.set_mode((1024, 600))

pygame.display.set_caption("Polyspiral")

incr = 0

running = True

while running:
	pygame.time.Clock().tick(60)
	for event in pygame.event.get():
		if event.type==QUIT:
			running = False
			break

	incr = (incr + 0.05) % 360
	x1 = pygame.display.Info().current_w / 2
	y1 = pygame.display.Info().current_h / 2
	length = 5
	angle = incr

	screen.fill((255,255,255))

	for i in range(1,151):
		x2 = x1 + math.cos(angle) * length
		y2 = y1 + math.sin(angle) * length
		pygame.draw.line(screen, (255,0,0), (x1, y1), (x2, y2), 1)
		
		x1, y1 = x2, y2
		length += 3
		angle = (angle + incr) % 360

	pygame.display.flip()
Task: Polyspiral



C#: using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.Windows.Threading;

namespace Polyspiral
{
    public partial class Form1 : Form
    {
        private double inc;

        public Form1()
        {
            Width = Height = 640;
            StartPosition = FormStartPosition.CenterScreen;
            SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.UserPaint |
                ControlStyles.DoubleBuffer,
                true);

            var timer = new DispatcherTimer();
            timer.Tick += (s, e) => { inc = (inc + 0.05) % 360; Refresh(); };
            timer.Interval = new TimeSpan(0, 0, 0, 0, 40);
            timer.Start();
        }

        private void DrawSpiral(Graphics g, int len, double angleIncrement)
        {
            double x1 = Width / 2;
            double y1 = Height / 2;
            double angle = angleIncrement;

            for (int i = 0; i < 150; i++)
            {
                double x2 = x1 + Math.Cos(angle) * len;
                double y2 = y1 - Math.Sin(angle) * len;
                g.DrawLine(Pens.Blue, (int)x1, (int)y1, (int)x2, (int)y2);
                x1 = x2;
                y1 = y2;

                len += 3;

                angle = (angle + angleIncrement) % (Math.PI * 2);
            }
        }

        protected override void OnPaint(PaintEventArgs args)
        {
            var g = args.Graphics;
            g.SmoothingMode = SmoothingMode.AntiAlias;
            g.Clear(Color.White);

            DrawSpiral(g, 5, ToRadians(inc));
        }

        private double ToRadians(double angle)
        {
            return Math.PI * angle / 180.0;
        }
    }
}





Python: import math

import pygame
from pygame.locals import *

pygame.init()
screen = pygame.display.set_mode((1024, 600))

pygame.display.set_caption("Polyspiral")

incr = 0

running = True

while running:
	pygame.time.Clock().tick(60)
	for event in pygame.event.get():
		if event.type==QUIT:
			running = False
			break

	incr = (incr + 0.05) % 360
	x1 = pygame.display.Info().current_w / 2
	y1 = pygame.display.Info().current_h / 2
	length = 5
	angle = incr

	screen.fill((255,255,255))

	for i in range(1,151):
		x2 = x1 + math.cos(angle) * length
		y2 = y1 + math.sin(angle) * length
		pygame.draw.line(screen, (255,0,0), (x1, y1), (x2, y2), 1)
		
		x1, y1 = x2, y2
		length += 3
		angle = (angle + incr) % 360

	pygame.display.flip()