BASIC User Group > Code Challenges

Generate QR code

(1/1)

jalih:
Your challenge is to generate a QR code for All BASIC forum website using your favorite programming language and library.

Below is a simple 8th version using built-in capability.


--- Code: ---needs utils/qrcode

: fname "qr.png" ;
: qr-str "https://www.allbasic.info/forum/index.php" ;

: app:main
  qr-str img:ECC-LOW img:qr-gen img:qr>img
  fname f:rm drop
  fname img:>file
  bye ;

--- End code ---

John:




--- Code: ---http://api.qrserver.com/v1/create-qr-code/?data=https%3A%2F%2Fwww.allbasic.info%2Fforum%2Findex.php&size=125x125

--- End code ---


AIR:
GO:


--- Code: Go ---package main import (        "os"         qrcode "github.com/skip2/go-qrcode") func main() {        err := qrcode.WriteFile("https://www.allbasic.info/forum/index.php", qrcode.Medium, 256, "qr.png")        if err != nil {                println("Error generating QR image...")                os.Exit(-1)        }} 

John:
I like the GO feature of being able to include code from the web.

I'm going to try using SB's pre-processor to acomplishish the same effect.

Navigation

[0] Message Index

Go to full version