32 lines
1.0 KiB
Nim
32 lines
1.0 KiB
Nim
# _____ ___ ____ ____ _____ ____ ____ _____ _____
|
|
# |_ _/ _ \| _ \ / ___|| ____/ ___| _ \| ____|_ _|
|
|
# | || | | | |_) | \___ \| _|| | | |_) | _| | |
|
|
# | || |_| | __/ ___) | |__| |___| _ <| |___ | |
|
|
# |_| \___/|_| |____/|_____\____|_| \_\_____| |_|
|
|
|
|
import std/random
|
|
|
|
type
|
|
HANDLE* = int
|
|
HWND* = HANDLE
|
|
UINT* = int32
|
|
LPCSTR* = cstring
|
|
|
|
proc MessageBox*(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT): int32
|
|
{.discardable, stdcall, dynlib: "user32", importc: "MessageBoxA".}
|
|
|
|
# example implementation: MessageBox(0, "Hello, world !", "Nim is Powerful", 0)
|
|
|
|
|
|
var
|
|
titlemessages = @["Are you really free?",
|
|
"Window on the street, only mesmerized and pondering... Am I in the right?"]
|
|
captionmessages = @["From the river to the sea, Palestine will be free.",
|
|
"I believe and have faith in you."]
|
|
|
|
randomize() # seeds randomizer
|
|
var
|
|
randomtitle:string = sample(titlemessages)
|
|
randommessage:string = sample(captionmessages)
|
|
|