LoginSignup
17
18

More than 5 years have passed since last update.

AndroidでBASICを使う( BASIC プログラミング )

Last updated at Posted at 2016-01-16

Androidのタブレットやスマホで利用できるBASICインタープリタを紹介します。

1.BASIC!

BASIC!は米国で開発されているプログラム言語BASICのインタープリタでGoogleプレイストアからダウンロードできます。

BASIC!

1-1.BASIC!の特徴

  • インタープリタなのでAndroidのタブレットやスマホのみでプログラミング、テスト、デバッグ可能。
  • ウィジェットで自作プログラムのアイコンをホーム画面に作成可能。
  • カメラ、GPS、センサー、ダイヤルなどAndroidネイティブの制御可能。

BASIC!の機能(開発元サイトより引用)

About BASIC!

RFO BASIC! is a dialect of Dartmouth Basic that allows you to write and run programs directly on your Android device. 
In addition to the traditional Basic features, your have access to:

  • Graphics (with Multi-touch)
  • HTML and JavaScript available for user interface
  • GPS
  • Device Sensors
  • Music Play
  • Sound Pools
  • Audio Recording
  • Tone Generation
  • Camera
  • Array/List/Stack/Bundle 
  • Internet Browsing
  • Text and Byte file I/O
  • Encryption
  • User defined functions
  • FTP Client
  • TCP/IP Client and Server Sockets
  • Bluetooth
  • Send SMS Messages
  • Send Emails
  • Make a phone call
  • Superuser access 
  • 無料。広告無し。

1-2.BASIC!公式サイト

BASIC!の開発は現在も継続中で最新バージョンは1.90です。
公式フォーラムでは盛んに投稿、議論が行われています。

2.BASIC!関連の海外サイト

BASIC!のプログラムを簡単にAPK化出来るツール等を配布しているサイトがあり利用されています。
※APK化には現状パソコンが必要です。

youtube動画表示エリア

3.BASIC!関連の日本語資料

3-1.BASIC!友の会関連

BASIC!友の会は、日本におけるBASIC!のユーザーコミュニティを目指しています。

b7cd38c60128e7ed.jpeg

youtube動画表示エリア
* BASIC!の紹介動画 その2(初心者向け)

youtube動画表示エリア

  • BASIC!超簡単HTMLモードプログラムの作り方講座(初級者向け)

youtube動画表示エリア

  • HTMLモードプログラムの作り方(中級者向け)

youtube動画表示エリア

3-2.その他の紹介サイト

日経ソフトウェアや月間I/Oなどの紙媒体でも紹介されていますがネット上でBASIC!を紹介しているページはあります。

4.コードの例

BASIC!専用の命令はありますが基本的には一般的なBASICのコードと同じです。

include a-htmlpnl1.bas
include t-htmlpnlem0.bas
include t-htmlpnlem1.bas
include t-htmlpnlem2.bas

console.title "画像エモーション判定"

dim emx$[8]

emx$[1]="怒り"
emx$[2]="軽蔑"
emx$[3]="嫌悪"
emx$[4]="怖れ"
emx$[5]="幸福"
emx$[6]="普通"
emx$[7]="悲み"
emx$[8]="嘆き"

socket.myip ip$
if ip$="" then
   popup "ネットワーク未接続なので終了します。",0,0,1
   pause 4000
   exit
else
   popup "ネットワーク接続済",0,0,1
   pause 4000
endif

rssstp:

clipboard.get clpx$

ansix$=embox0$(clpx$)


if ansix$="//x//" then
   popup "終了します。",0,0,1
   exit
endif

ansiy$=embox1$(clpx$)

if ansiy$="//e//" then
   popup "終了します。",0,0,1
   exit
endif

console.title "画像エモーション判定 データ生成中"

split iya$[],ansiy$,"@x@"
array.length liya,iya$[]

outww$=""

cls

for vv=1 to liya 
   print iya$[vv]
   ww=val(iya$[vv])
   ww=int(ww*10)
      sikaku$=""
      for www=1 to ww
        sikaku$=sikaku$+"■"
      next ww
   outww$=outww$+emx$[vv]+":"+sikaku$+"<BR>"
   outaa$=emx$[vv]+":"+sikaku$
   print outaa$
next vv

array.delete iya$[]

ansiz$=embox2$(clpx$,outww$)

if ansiz$="//x//" then
   popup "終了します。",0,0,1
   exit
endif

if ansiz$="//y//" then
   popup "検索画面を表示します。",0,0,1
   goto rssstp
endif

exit

5.まとめ

  • Androidの端末さえあれば無料。
  • 開発環境はアプリのインストールだけで瞬時に作成。
  • アプリを作って配布も可能。
  • BASICなので超簡単。

ちょっと試してみてはいかがでしょうか。

17
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
18