[code=thinbasic]' Example 3.2 Super-D Numbers
' From Stan Blank's Book:
' "Python Programming in OpenGL
' "A Graphical Approach to Programming
' Converted by Kent Sarikaya
' Last modified: February 25, 2010
' Since this is a console app, need to use the Console Module
' The string and other features used are part of the core module
' so no need to use any other Uses modules
Uses "Console"
' Uncomment the next line if you want to run in fullscreen mode
'Console_FullScreen()
' We can use Aliases in thinBasic
' now Input can be used as Console_Read
Alias Console_Read As Input
' The long type was not big enough, so I used quad
Dim i, n, x, d As Quad
PrintL("Super-D fun!")
PrintL("For example: 4 - this will be any D^4 * 4 which contains 4444")
PrintL("Another example: 2 - this will be any D^2 * 2 which contains 22")
Print("Please enter the number for Super-D: ")
d = Val(Input())
Print("Please enter the upper bound: ")
i = Val(Input())
For n = 1 To i
x = d*n^d
If InStr(Str$(x),Repeat$(d,TrimFull$(Str$(d)))) Then PrintL( n + " " + x )
Next
Print("Finished - press any key to exit")
WaitKey
'Based on exercise 1 - pg.21[/code]
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Bookmarks