[S] Worked on nim.
This commit is contained in:
31
elinethingz/utils/basicadware.nim
Normal file
31
elinethingz/utils/basicadware.nim
Normal file
@@ -0,0 +1,31 @@
|
||||
# _____ ___ ____ ____ _____ ____ ____ _____ _____
|
||||
# |_ _/ _ \| _ \ / ___|| ____/ ___| _ \| ____|_ _|
|
||||
# | || | | | |_) | \___ \| _|| | | |_) | _| | |
|
||||
# | || |_| | __/ ___) | |__| |___| _ <| |___ | |
|
||||
# |_| \___/|_| |____/|_____\____|_| \_\_____| |_|
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user