Computer Science Canada

Numeric Password Generator

Author:  wrathofpyro [ Sat May 20, 2006 10:29 am ]
Post subject:  Numeric Password Generator

This is my first program ever! It is written in turing.Although it's simple, it's rather useful. You tell it the length you want your password to be then it generates a numerical password in the length you specified!It even has a restart button at the end Shocked. Sugestions(sp?) are welcome and I would like to know how I can highlight and copy the password too.

Author:  Cervantes [ Sat May 20, 2006 10:58 am ]
Post subject:  Re: Numeric Password Generator

wrathofpyro wrote:
I would like to know how I can highlight and copy the password too.

Use
code:
View.Set ("text")

Silly Holtsoft starting in graphics mode by default...

Author:  wrathofpyro [ Sat May 20, 2006 11:41 am ]
Post subject: 

err how the hell do I use that Confused

Author:  Cervantes [ Sat May 20, 2006 12:12 pm ]
Post subject: 

Just copy and paste that code into your turing program, preferrably before you do any outputting. Your best bet is to put it at the start of your program.

Author:  wrathofpyro [ Sat May 20, 2006 1:37 pm ]
Post subject: 

err it acts as if the code wasnt there at all Embarassed

Author:  Cervantes [ Sat May 20, 2006 7:01 pm ]
Post subject: 

That could be because you later did a
code:
View.Set ("graphics:###;###")

Or perhaps because you opened a new window afterwards. Ideally, you should have only one View.Set line (could be a Window.Open). Stick "text" in there, separated by commas (,) from the other parts of that line.

If you can't get it to work, you've got two options:
1) Post your code
2) Give up

Edit: I thought uploading .exe's wasn't allowed?

Author:  wrathofpyro [ Sun May 21, 2006 9:16 am ]
Post subject: 

code:
var win : int
win := Window.Open ("position:center,graphics:400;300")
setscreen ("graphics")
color (white)
colorback (black)
loop
    cls
    var mypic : int := Pic.FileNew ("coolpic.bmp")
    Pic.Draw (mypic, maxx div 10000000, maxy div 60000000, 0)

    var a, c, d : int
    var z : char

    put "This a random numeric password generator"
    put "Enter the length you want your password to be." ..
    get d
    c := 0
    put "Your " ..
    put d ..
    put " characters long password is : " ..
    randomize
    loop
        randint (a, 1, 9)
        c := c + 1
        put a ..
        exit when c = d
    end loop
    loop
        put " "
        put "Do you wish to do generate another password? ( Y / N )" ..
        get z
        exit when z = 'n' or z = 'y' or z = 'Y' or z = 'N'
        cls
        put "Invalid, please enter Y or N"

    end loop
    exit when z = 'n'
end loop



Edit: removed name.

Author:  HellblazerX [ Sun May 21, 2006 9:55 am ]
Post subject: 

wrathofpyro wrote:
code:

win := Window.Open ("position:center,graphics:400;300")
setscreen ("graphics")


That's your problem. You wanted to set the screen to text mode, but instead you setted it to graphics. Replace the word graphics with text.

Also, you won't be able to use these commands if you set the screen to text mode:

code:

color (white)
colorback (black)
cls
var mypic : int := Pic.FileNew ("coolpic.bmp")
Pic.Draw (mypic, maxx div 10000000, maxy div 60000000, 0)


And what's the picture for? And why use those coordinates, when all they come out to is 0.

Author:  xAXISx [ Thu Jun 29, 2006 10:02 pm ]
Post subject: 

If you wanted to make it include characters, make an array with the characters in the alphabet and have it include random occurances of that.

Author:  Dev!L_RoosteR [ Sun Jul 23, 2006 11:24 pm ]
Post subject: 

hmmmm there seem to be an error in your program... when you enter
the number 1000000000 for how many numbers there supposed to be it
seem to go in a loop.... fascinating Confused


just kidding real nice program... although could have been nicer if the
numbers could be on a seperate line to ease on the eyes while searching for it

but hey its nothing! Very Happy good job keep up the good work


: