Write RAM with RAM itself!!!

Tech Guru
0

 

 Write RAM with RAM itself!!!


Here we are going to discuss, how to write RAM image in python terminal with the help of a library named turtle.As we all know that it is the one of the most interesting library inside the python. Mainly this type of library is inbuilt with the python software.

Getting start with python : 

To get started with Python Turtle, you need to have Python installed on your computer. If you don't have it installed, click here to download it from the official Python website.You can also follow this video to download python inside your computer.



Code to write RAM: 

You can see this video for coding to draw the same image to write RAM with RAM as given above




Code to write Ram with your python turtle is given below. You can just copy it out from here and paste it into your python file. By clicking on run the program you can definitely see the same output as shown above.

from turtle import *
import numpy
title("राम  राम  राम  राम  राम  राम  राम  राम  राम  राम  राम  राम  राम  राम ")
setup(700, 750)
bgcolor("black")
colormode(255)
speed(0)

x = -200
y = 200

def ram_name():
    c = tuple(numpy.random.
              randint(0, 255, 3))

    color(c)
    write("राम", font=("Arial", 10, "bold"))

def draw(i):
    global x, y
    penup()
    goto(x, y)
    pendown()
    x -= i
    y -= 15
    ram_name()

for _ in range(4):
    draw(10)

x -= 15
y += 23
for _ in range(7):
    draw(-10)

x = -150
y = 200


def line(lo=9):
    global x, y
    for _ in range(lo):
        penup()
        goto(x, y)
        pendown()
        y -= 15
        ram_name()


line()
x = -80
y = 200
line(8)
for _ in range(3):
    x -= 15
    y += 15
    penup()
    goto(x, y)
    pendown()
    ram_name()

for _ in range(8):
    x += 15
    penup()
    goto(x, y)
    pendown()
    ram_name()
x = 10
y = 200
line()
x = -240
y = 215
for _ in range(20):
    penup()
    goto(x, y)
    pendown()
    ram_name()
    x += 15
hideturtle()
exitonclick()

Hope you had fun going through this blog and write Ram with Ram using a few simple methods provided by python turtle.If you like this kind of drawing please share and follow your page for more such type of creative idea.

Post a Comment

0Comments
Post a Comment (0)