Wednesday, 27 January 2021

Game No. 5 : PING - PONG Menu Based game to select level and paddle color by S P SHARMA CLASSES

 

Game No. 5 : PING - PONG Menu Based game to select level and paddle color by S P SHARMA CLASSES



#PING - PONG Menu Based game to select level and paddle color by Sachin Kumar, 9910707562

#sachinpgt2019@gmail.com

import pygame

import random,sys

 

pygame.init()

clock = pygame.time.Clock()

 

sw = 800

sh = 600

screen = pygame.display.set_mode((sw,sh))

pygame.display.set_caption("PING--PONG BY SACHIN KUMAR")

bg_color = pygame.Color('red')

game_font = pygame.font.Font('freesansbold.ttf', 60)

font1 = pygame.font.SysFont("comicsansms", 45)

p_color="red"

b_color="blue"

level = 1

opponent_speed = 6

 

score_time = None


def c_color(OS1):

    global p_color,b_color

    sw = 800

    sh = 600

 

    ball = pygame.Rect(sw//2 - 15, sh//2 - 15, 30, 30)

    player = pygame.Rect(sw-20, sh//2 - 60, 10, 120)

    opponent = pygame.Rect(10, sh//2 - 60, 10, 120)

 

    bg_color = pygame.Color('yellow')


    running  = True

    while running:

        screen.fill(bg_color)

        for event in pygame.event.get():

            if event.type == pygame.QUIT:

                welcomscreen = False

                pygame.quit()

                sys.exit(0)

     

            if event.type == pygame.KEYDOWN:

                if event.key == pygame.K_SPACE:

                    welcomscreen = False

                    StartGame(OS1)

                if event.key == pygame.K_1:

                    p_color="red"

                    b_color="blue"

     

                elif event.key == pygame.K_2:

                    p_color="black"

                    b_color="red"

     

                elif event.key == pygame.K_3:

                    p_color="blue"

                    b_color="red"


        if p_color=="red":

            pygame.draw.rect(screen, (250,0,0), pygame.Rect(sw//2-190, sh-410, 350, 70), 2)

        elif p_color=="black":

            pygame.draw.rect(screen, (250,0,0), pygame.Rect(sw//2-190, sh-310, 350, 70), 2)

        elif p_color=="blue":

            pygame.draw.rect(screen, (250,0,0), pygame.Rect(sw//2-190, sh-210, 350, 70), 2)

 


        Welcome_message = font1.render("PING PONG BY SACHIN KUMAR", True, (250,0,0))

        screen.blit(Welcome_message, (sw//2 - 320, 20))

     

        Select_level = font1.render("SELECT PADDLE COLOR", True, (250,0,0))

        screen.blit(Select_level, (sw//2 - 230, sh-500))

     

        Easy = game_font.render("RED", True, (250,0,0))

        screen.blit(Easy, (sw//2 - 90, sh-400))

     

        Medium = game_font.render("BLACK", True, (250,0,0))

        screen.blit(Medium, (sw//2-130, sh-300))

     

        Hard = game_font.render("BLUE", True, (250,0,0))

        screen.blit(Hard, (sw//2 - 90, sh-200))

     

        Start_game = font1.render("PRESS SPACE TO START", True, (250,0,0))

        screen.blit(Start_game, (sw//2-260, sh-100))

        clock.tick(30)

        pygame.display.update()


def StartGame(OS):

    global score_time

    sw = 800

    sh = 600

 

    ball = pygame.Rect(sw//2 - 15, sh//2 - 15, 30, 30)

    player = pygame.Rect(sw-20, sh//2 - 60, 10, 120)

    opponent = pygame.Rect(10, sh//2 - 60, 10, 120)

 

    bg_color = pygame.Color('yellow')

 

    ball_speed_x = 6*random.choice((-1,1))

    ball_speed_y = 6*random.choice((-1,1))

 

    player_speed = 0

    opponent_speed = OS

 

    player_score = 0

    opponent_score = 0

 

    game_font = pygame.font.Font('freesansbold.ttf', 32)

 

    score_time = None

    def ball_restart():

        global score_time

        ball.center = (sw//2 + 7, sh//2)

        #ball.x = sw//2 - 15

        #ball.y = sh//2 - 15

        current_time = pygame.time.get_ticks()

        if current_time - score_time <= 2000:

            ball_speed_x = 0

            ball_speed_y = 0

 

        if current_time - score_time > 2000:

            ball_speed_x = 6*random.choice((-1,1))

            ball_speed_y = 6*random.choice((-1,1))

            score_time = None

 

    running  = True

    while running:

        screen.fill(bg_color)

        for event in pygame.event.get():

            if event.type == pygame.QUIT:

                running = False

                pygame.quit()

                sys.exit(0)

 

            if event.type == pygame.KEYDOWN:

                if event.key == pygame.K_UP: player_speed -= 7

                if event.key == pygame.K_DOWN: player_speed += 7

 

            if event.type == pygame.KEYUP:

                if event.key == pygame.K_UP: player_speed += 7

                if event.key == pygame.K_DOWN: player_speed -= 7

        

 

        #SCORE

        if ball.left <= 0:

            score_time = pygame.time.get_ticks()

            player_score += 1

            ball_restart()

 

        if ball.right >= sw:

            score_time = pygame.time.get_ticks()

            opponent_score += 1

            ball_restart()

 

        if score_time:

            ball_restart()

 

        #COLLISION

        if ball.colliderect(player) or ball.colliderect(opponent):

            ball_speed_x *= -1

 

        #BALL MOVEMENT

        ball.x += ball_speed_x

        ball.y += ball_speed_y

 

        if ball.top <= 0 or ball.bottom >= sh:

            ball_speed_y *= -1

        

        if ball.left <= 0 or ball.right >= sw:

            ball_speed_x *= -1

 

        #PLAYER MOVEMENT

        player.y += player_speed

        if player.top <= 0:

            player.top = 0

        if player.bottom >= sh:

            player.bottom = sh

 

        #OPPONENT MOVEMENT

        if opponent.bottom < ball.y:

            opponent.bottom += opponent_speed

        if opponent.top > ball.y:

            opponent.top -= opponent_speed

 

        pygame.draw.rect(screen, p_color, player)

        pygame.draw.rect(screen, p_color, opponent)

        pygame.draw.ellipse(screen, b_color, ball)

        pygame.draw.aaline(screen, (200,200,200), (sw//2,0), (sw//2,sh))

 

        player_text = game_font.render(str(player_score), True, (250,0,0))

        screen.blit(player_text, (sw//2 + 20, sh//2 - 16))

 

        opponent_text = game_font.render(str(opponent_score), True, (250,0,0))

        screen.blit(opponent_text, (sw//2 - 42, sh//2 - 16))

 

        clock.tick(30)

        pygame.display.update()

 

 

welcomscreen = True

while welcomscreen:

    screen.fill(bg_color)

    for event in pygame.event.get():

        if event.type == pygame.QUIT:

            welcomscreen = False

            pygame.quit()

            sys.exit(0)

 

        if event.type == pygame.KEYDOWN:

            if event.key == pygame.K_SPACE:

                welcomscreen = False

                #pygame.quit()

                #sys.exit(0)

                c_color(opponent_speed)

                #StartGame(opponent_speed)

            if event.key == pygame.K_1:

                level = 1

                opponent_speed = 6

 

            elif event.key == pygame.K_2:

                level = 2

                opponent_speed = 10

 

            elif event.key == pygame.K_3:

                level = 3

                opponent_speed = 13

 

    #pygame.draw.rect(screen, (250,0,0), pygame.Rect(sw//2, sh-140, 350, 70), 2)

 

    if level == 1:

        pygame.draw.rect(screen, (0,0,250), pygame.Rect(sw//2-190, sh-410, 350, 70), 2)

    elif level == 2:

        pygame.draw.rect(screen, (0,0,250), pygame.Rect(sw//2-190, sh-310, 350, 70), 2)

    elif level == 3:

        pygame.draw.rect(screen, (0,0,250), pygame.Rect(sw//2-190, sh-210, 350, 70), 2)

 

    

    Welcome_message = font1.render("PING PONG BY SACHIN KUMAR", True, (250,250,250))

    screen.blit(Welcome_message, (sw//2 - 320, 20))

 

    Select_level = game_font.render("SELECT LEVEL", True, (250,250,250))

    screen.blit(Select_level, (sw//2 - 200, sh-500))

 

    Easy = game_font.render("EASY", True, (250,250,250))

    screen.blit(Easy, (sw//2 - 90, sh-400))

 

    Medium = game_font.render("MEDIUM", True, (250,250,250))

    screen.blit(Medium, (sw//2-130, sh-300))

 

    Hard = game_font.render("HARD", True, (250,250,250))

    screen.blit(Hard, (sw//2 - 90, sh-200))

    

    Start_game = font1.render("PRESS SPACE TO SELECT COLOR", True, (250,250,250))

    screen.blit(Start_game, (sw//2-360, sh-100))

 

    clock.tick(30)

    pygame.display.update()



 


Tuesday, 26 January 2021

VBscript class-12 (part-2 input-box)

 <html>

<body>

<script type="text/VBScript">


a=inputBox("Enter a number")

msgBox a

b=inputBox("Enter a number","Input Box")

msgBox b


c=inputBox("Enter a number","Input Box", 123)

msgBox c


</script>

</body>

</html>

VB script class 12 (part 1 message box)

 <html>

<body>

<script type="text/VBScript">

'MsgBox("Hello from VBScript <br/> Hello from VB")

'MsgBox("Hello from VBScript" & VbLf & "Hello from VB")

's1="ram"

's2="kumar"

'MsgBox(s1 & " " & s2)




'msgBox("1-HelloIndia")

'msgBox "1-HelloIndia"

'msgBox("2-HelloIndia" & vblf & "HelloDelhi")

'msgBox("3-HelloIndia" & vbcr & "HelloDelhi")

'msgBox("3-HelloIndia" & chr(10) & "HelloDelhi")

'msgBox("3-HelloIndia" & chr(13) & "HelloDelhi")

'msgBox "0-HelloIndia",0

'msgBox "1-HelloIndia",1

'msgBox "2-HelloIndia",2

'msgBox "3-HelloIndia",3

'msgBox "4-HelloIndia",4

'msgBox "5-HelloIndia",5


'msgBox "16-Error",16

'msgBox "32-Question",32

'msgBox "48-Warning",48

'msgBox "64-Information",64

'msgBox "0-Default",3+16+0

'msgBox "256-Default",3+16+256

'msgBox "512-Default",3+16+512

msgBox "0-Application Model",3+16+512+0

msgBox "4096-System Model",3+16+512+4096

msgBox "0-Application Model",3+16+512+0, "Application Model"

msgBox "4096-System Model",3+16+512+4096, "System Model"

</script>

</body>

</html>

Monday, 25 January 2021

Concurrency Control Protocol MCQ

 Concurrency Control Protocol MCQ


1.      If a transaction has obtained a __________ lock, it can read but cannot write on the item
a) Shared mode
b) Exclusive mode
c) Read only mode
d) Write only mode

2.      If a transaction has obtained a ________ lock, it can both read and write on the item
a) Shared mode
b) Exclusive mode
c) Read only mode
d) Write only mode

3.      A transaction can proceed only after the concurrency control manager ________ the lock to the transaction
a) Grants
b) Requests
c) Allocates
d) None of the mentioned

4.      If a transaction can be granted a lock on an item immediately in spite(बावजूद)  of the presence of another mode, then the two modes are said to be ________
a) Concurrent
b) Equivalent
c) Compatible
d) Executable

5.      A transaction is made to wait until all ________ locks held on the item are released
a) Compatible
b) Incompatible
c) Concurrent
d) Equivalent

6.      The situation where no transaction can proceed with normal execution is known as ________
a) Road block
b) Deadlock
c) Execution halt
d) Abortion

7.      The protocol that indicates when a transaction may lock and unlock each of the data items is called as __________
a) Locking protocol
b) Unlocking protocol
c) Granting protocol
d) Conflict protocol

8.      If a transaction T may never make progress, then the transaction is said to be ____________
a) Deadlocked
b) Starved
c) Committed
d) Rolled back

9.      The two phase locking protocol consists which of the following phases?
a) Growing phase
b) Shrinking phase
c) Both a and b
d) None of the mentioned

10.   If a transaction may obtain locks but may not release any locks then it is in _______ phase
a) Growing phase
b) Shrinking phase
c) Deadlock phase
d) Starved phase

11.   If a transaction may release locks but may not obtain any locks, it is said to be in ______ phase
a) Growing phase
b) Shrinking phase
c) Deadlock phase
d) Starved phase

12.   Which of the following cannot be used to implement a timestamp
a) System clock
b) Logical counter
c) External time counter
d) None of the mentioned

13.   A logical counter is _________ after a new timestamp has been assigned
a) Incremented
b) Decremented
c) Doubled
d) Remains the same

14.   Which of the following timestamp based protocols generates serializable schedules?
a) Thomas write rule
b) Timestamp ordering protocol
c) Validation protocol
d) None of the mentioned

15.   The _________ requires each transaction executes in two or three different phases in its lifetime
a) Validation protocol
b) Timestamp protocol
c) Deadlock protocol
d) View protocol

16.   During __________ phase, the system reads data and stores them in variables local to the transaction.
a) Read phase
b) Validation phase
c) Write phase
d) None of the mentioned

17.   During the _________ phase the validation test is applied to the transaction
a) Read phase
b) Validation phase
c) Write phase
d) None of the mentioned

18.   During the _______ phase, the local variables that hold the write operations are copied to the database
a) Read phase
b) Validation phase
c) Write phase
d) None of the mentioned

19.   Read only operations omit the _______ phase
a) Read phase
b) Validation phase
c) Write phase
d) None of the mentioned

 

Sunday, 24 January 2021

List of Python with CS practical for class 12

 


List of Python with CS practical for class 12 


Part – 1 Python with CS

1)     WAP in Python to find the factorial of a number using function.

2)     WAP in Python to implement default and positional parameters.

3)     Write a program in Python to input the value of x and n and print the sum of the following series

1+x+x^2+x^3+ ----------------x^n

4)     WAP in Python to read a text file and print the number of vowels and consonants in the file.

5)     WAP in Python to read a text file and print the line or paragraph starting with the letter ‘S’

6)     WAP in Python to read a text fileand print the number of uppercase and lowercase letters in the file.

7)     WAP in Python to create a binaryfile with name and roll number of the students. Search for a given roll numberand display the name of student.

8)     Create a binary file with roll_no,name and marks of some students and update the marks of specific student.

9)     Create a binary file with eid, ename and salary and update the salary of the employee.

10)  Create a text file and remove the lines from the file which contains letter ‘K’

11)  Create a binary file with 10 random numbers from 1 to 40 and print those numbers.

12)  Write a program in Python to create a CSV file with the details of 5 students.

13)  WAP in Python to read a CSV file.

14)  Write a menu driven program which insert, delete and display the details of an employee such as eid, ename and salary using Stack.

15)  Write a menu driven program which insert, delete and display the details of a book such as book_id, book_name and price using Stack.

16)  Write a menu driven program which insert, delete and display the details of a student such as roll_no, sname and course using Stack.

17)  Write a menu driven program which insert, delete and display the details of a movie such as movie_id, mname and rating using Stack.

18)  Write a menu driven program which insert, delete and display the details of a product such as pid, pname and price using Stack.

19)  Write a menu driven program which insert, delete and display the details of a club such as club_id, cname and city using Stack.

20)  Write a menu driven program to demonstrate add, display, update, delete and exit. Performed on a table Book containing (bid, bname, bprice) through python-MySql connectivity.

21)  Write a menu driven program to demonstrate add, display, update, delete and exit. Performed on a table Product containing (pid, pname, price) through python-MySql connectivity.

22)  Write a menu driven program to demonstrate add, display, update, delete and exit. Performed on a table club containing (club_id, cname, city) through python-MySql connectivity.

23)  Write a menu driven program to demonstrate add, display, update, delete and exit. Performed on a table student containing (sid, sname, course) through python-MySql connectivity.

24)  Write a menu driven program to demonstrate add, display, update, delete and exit. Performed on a table movie containing (mid, mname, rating) through python-MySql connectivity.

25)  Write a menu driven program to demonstrate add, display, update, delete and exit. Performed on a table Employee containing (eid, ename, salary) through python-MySql connectivity.


Part – 2 MYSQL

SQL Practical

VBScript Class - 11

  VBScript Class - 11 by S P SHARMA CLASSES (7048972696)


<html>

<body>

<script type="text/VBScript">

s1="Manmohan"

s2="n"

n1=instr(s1,s2)

document.write("n1=" & n1 & "<br/>")

n2=instr(n1+1,s1,s2)

document.write("n2=" & n2 & "<br/>")


nr1=instrrev(s1,s2)

document.write("nr1=" & nr1 & "<br/>")

nr2=instrrev(s1,s2,6)

document.write("nr2=" & nr2 & "<br/>")

L=left(s1,3)

document.write("Left 3=" & L & "<br/>")

R=Right(s1,5)

document.write("Right 5=" & R & "<br/>")

M1=mid(s1,3,4)

document.write("M1=" & m1 & "<br/>")

M2=mid(s1,1,3)

document.write("M2=" & m2 & "<br/>")

M3=mid(s1,4,5)

document.write("M3=" & m3 & "<br/>")


S3="Sachin Parashar Sharma"

fname=left(s3,6)

document.write("fname=" & fname & "<br/>")

mname=mid(s3,8,8)

document.write("mname=" & mname & "<br/>")

lname=right(s3,6)

document.write("lname=" & lname & "<br/>")


document.write("........................<br/><br/>")

'S4=inputbox("Enter Your Name")

S4="Sachin Parashar Sharma"

fname=left(s4,6)

document.write("fname=" & fname & "<br/>")

mname=mid(s4,8,8)

document.write("mname=" & mname & "<br/>")

lname=right(s4,6)

document.write("lname=" & lname & "<br/>")


document.write("........................<br/><br/>")


document.write("Lcase=" & lcase(s3) & "<br/>")

document.write("Ucase=" & ucase(s3) & "<br/>")

document.write("Len=" & len(s3) & "<br/>")

S4="         Hello         India        "

document.write("S4=" & s4 & "<br/>")

document.write("S4=" & ltrim(s4) & "<br/>")

document.write("S4=" & rtrim(s4) & "<br/>")

document.write("S4=" & trim(s4) & "<br/>")


document.write("S3=" & replace(s3,"Sharma","Verma") & "<br/>")

document.write("S3=" & S3 & "<br/>")


document.write( strcomp("ram","raj") & "<br/>")

document.write( strcomp("ram","ram") & "<br/>")

document.write( strcomp("raj","ram") & "<br/>")

document.write( string(5,"ram") & "<br/>")

document.write( string(50,"*") & "<br/>")

document.write( strreverse("Hello") & "<br/>")

document.write( strreverse("150.58") & "<br/>")

</script>

</body>

</html>

VBScript Class - 10

  VBScript Class - 10 by S P SHARMA CLASSES (7048972696)


<html>

<body>

<script type="text/VBScript">

dim x

x="Ram"

document.write("x=" & x & "<br/>")

dim y

'y='R'

y=8.5

document.write("y=" & y & "<br/>")

a=#2021/01/24#

document.write("a=" & a & "<br/>")


a=#01/24/2021#

document.write("a=" & a & "<br/>")


a=#20:18#

document.write("a=" & a & "<br/>")


a=#08:19:20 PM#

document.write("a=" & a & "<br/>")


document.write("........................<br/><br/>")


dim B(3)

B(0)="Ram"

B(1)="Raj"

B(2)="Sam"

B(3)="John"


for i =0 to 3

document.write(B(i) & "<br/>")

next

document.write("........................<br/><br/>")


for each i in B

document.write(i & "<br/>")

next


document.write("........................<br/><br/>")


Dim Emp

Emp=Array("Amit",25,#01/24/1990#)

for each i in Emp

document.write(i & "<br/>")

next

document.write("........................<br/><br/>")


public C(2,3)

C(0,0)=0

C(0,1)=1

C(0,2)=2

C(0,3)=3


C(1,0)=4

C(1,1)=5

C(1,2)=6

C(1,3)=7


C(2,0)=8

C(2,1)=9

C(2,2)=1

C(2,3)=2



for i=0 to 2

for j=0 to 3

document.write(C(i,j) & "  ")

next

document.write("<br/>")

next


document.write("Dynamic Array........................<br/><br/>")


private D()

Redim D(2)

D(0)="Ram"

D(1)=25

D(2)=25000

for each i in D

document.write(i & "<br/>")

next


document.write("Dynamic Array........................<br/><br/>")

redim preserve D(4)

D(3)="Delhi"

D(4)="IT"

for each i in D

document.write(i & "<br/>")

next



document.write("Dynamic Array........................<br/><br/>")

redim D(6)

D(5)=#01/05/1995#

D(6)="Dr. Mukherjee Nagar"

for i=0 To 6

document.write(i+1 & " Element= " & D(i) & "<br/>")

next

</script>

</body>

</html>

VBScript Class - 9

  VBScript Class - 9 by S P SHARMA CLASSES (7048972696)


<html>

<body>

<script type="text/VBScript">


document.write("Call byRef.............<br/><br/>")

function show(x)

x=x+3

show=x

end function


dim x

x=5

document.write("Before calling x=" & x & "<br/>")

call show(x)

document.write("After calling x=" & x & "<br/>")



document.write("Call byVal.............<br/><br/>")


function change(byVal y)

y=y+3

change=y

document.write("Inside change y=" & y & "<br/>")

end function


dim y

y=5

document.write("Before calling y=" & y & "<br/>")

call change(y)

document.write("After calling y=" & y & "<br/>")



document.write("Call byRef.............<br/><br/>")

function show1(byRef x1)

x1=x1+3

show1=x1

end function


dim x1

x1=5

document.write("Before calling x1=" & x1 & "<br/>")

call show1(x1)

document.write("After calling x1=" & x1 & "<br/>")


</script>

</body>

</html>

VBScript Class - 8

  VBScript Class - 8 by S P SHARMA CLASSES (7048972696)


<html>

<body>

<script type="text/VBScript">


document.write("<br/>...................</br></br>")

x=1

do 

if x=5 then exit do

document.writeln(x & "<br>")

x=x+1

Loop while x<11


document.write("<br/>...................</br></br>")

x=1

do while x<11

if x=5 then exit do

document.writeln(x & "<br>")

x=x+1

Loop 



document.write("<br/>...................</br></br>")

x=1

do until x>11

if x=5 then exit do

document.writeln(x & "<br>")

x=x+1

Loop 


document.write("<br/>...................</br></br>")

x=1

while x<11

'if x=5 then exit do

document.writeln(x & "<br>")

x=x+1

wend



document.write("<br/>...................</br></br>")

dim emp(2)

emp(0)="Ram"

emp(1)=5

emp(2)=8.6

'emp(3)="Raj"

document.write("emp(0)=" & emp(0) & "<br/>")

document.write("emp(1)=" & emp(1) & "<br/>")

document.write("emp(2)=" & emp(2) & "<br/>")


document.write("<br/>...................</br></br>")

dim std(4)

std(0)="Ram"

std(1)="Raj"

std(2)="Sam"

std(3)="John"

std(4)="Amit"

for each x in std

document.write(x & "<br/>")

next

document.write("<br/>...................</br></br>")

call show()


sub show()

document.write("Hello from VBScript Sub Procedure<br/>")


end sub


call show()

call display()

function display()

document.write("Hello from VBScript Function<br/>")


end function

call display()


document.write("<br/>...................</br></br>")


sub show1(x)

document.write("x=" & x &"<br/>")

end sub


call show1(10)



function findarea(r)

const pi =3.14

area=pi*r*r

document.write("area=" & area &"<br/>")

end function


findarea(3)

call findarea(2)


document.write("<br/>...................</br></br>")

function findarea(r)

const pi =3.14

area=pi*r*r

findarea=area

end function



document.write("area=" & findarea(10) &"<br/>")


k=findarea(20)

document.write("area=" & k &"<br/>")


r1=inputbox("Enter the radius of circle")

k=findarea(r1)

document.write("area=" & k &"<br/>")


</script>

</body>

</html>

VBScript Class - 7

 

 VBScript Class - 7 by S P SHARMA CLASSES (7048972696)


<html>

<body>

<script type="text/VBScript">

Dim i, j 

For i = 1 To 5

For j = 1 To 5

document.write(j)

Next

document.write("<br/>")

Next


document.write("<br/>...................</br></br>")


For i = 1 To 5

For j = 1 To 5

document.write(i)

Next

document.write("<br/>")

Next



document.write("<br/>...................</br></br>")


For i = 1 To 5

For j = 1 To i

document.write(j)

Next

document.write("<br/>")

Next


document.write("<br/>...................</br></br>")


dim x

x=1

do while x<5

document.writeln(x)

x=x+1

Loop



document.write("<br/>...................</br></br>")


'dim x

x=1

do while x<5

x=x+1

document.writeln(x)

Loop




document.write("<br/>...................</br></br>")



x=1

do 

document.writeln(x)

x=x+1

Loop while x<5



document.write("<br/>...................</br></br>")



x=1

do 

x=x+1

document.writeln(x)

Loop while x<5



document.write("<br/>...................</br></br>")

x=1

do 

x=x+1

document.writeln(x)

Loop while x<1



document.write("<br/>...................</br></br>")

x=1

do while x<1

x=x+1

document.writeln(x)

Loop




document.write("<br/>...................</br></br>")

x=1

do until x=5

document.writeln(x)

x=x+1

Loop


document.write("<br/>...................</br></br>")

x=10

do until x>5

document.writeln(x)

x=x-1

Loop



document.write("<br/>...................</br></br>")

x=10

do until x<5

document.writeln(x)

x=x-1

Loop




document.write("<br/>...................</br></br>")

x=1

while x<5

document.writeln(x)

x=x+1

wend

</script>

</body>

</html>