Author Topic: ATI-BASIC  (Read 41216 times)

0 Members and 1 Guest are viewing this topic.

Offline miotatsu

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 332
  • Rating: +11/-1
    • View Profile
ATI-BASIC
« on: December 24, 2009, 03:23:09 am »
BasiC++ will be an interpreted programming language for the PC based directly off of Ti-Basic
currently it has:
ClrDraw
Pxl-On
Pxl-Off
Pxl-Change
Getkey(sort of)
storing(sort of)

right now i am working on the font system to be used with Text()

current features i want to get implemented are:
and
Ans
Else
End
For
getkey
Goto
If
Input
Lbl
not
or
Pause
Prgm
Prompt
Pxl-Test
RecallPic
Repeat
Return
Stop
Text
While
xor

credits go to pifreak for the original BasiC++ source :{D

info on why file loading wasn't working:

i was declaring
std::string Filename;
globally, (this is a string to hold the name of the file that gets loaded into the system, its declared globally so everything can use the code, it isn't limited to one single function)
next in the main function i stored the contents of the Filename into the string so that it can be opened in my run() function
std::string Filename = argv[1];
(when you drag and drop a file onto the program the name of the file is stored in Argv[1])
This will not work. What happens here is that the string is re-declared locally, this means it can't be used outside of main, this is because putting std::string in front of Filename tells it that you are declaring filename as a string, which overides the previous declaration.
in order to fix this you simply do
Filename = argv[1];
as can be seen it is a very basic mistake, but it should definitely be payed attention to because it can cause a lot of trouble if one doesn't understand it
thanks go to Chile from Efnet's #C++ for pointing this out to me, and pifreak for helping as well and stuff :)
« Last Edit: January 07, 2011, 07:59:28 pm by miotatsu »

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: BasiC++
« Reply #1 on: December 24, 2009, 11:17:41 am »
I see you have "and", so I was wondering if you would include "or" and/or "xor" also?

Offline miotatsu

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 332
  • Rating: +11/-1
    • View Profile
Re: BasiC++
« Reply #2 on: December 24, 2009, 12:22:04 pm »
ah thanks, i overlooked those *updates post*

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: BasiC++
« Reply #3 on: December 24, 2009, 12:38:05 pm »
Hmm, I could get to like this when it's done :p a good way to transition to computur languages when the time comes. So with this, does it use the whole screen? Or just a window?
/e

Offline miotatsu

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 332
  • Rating: +11/-1
    • View Profile
Re: BasiC++
« Reply #4 on: December 24, 2009, 03:01:57 pm »
right now it just uses a small little window the same size as a calc screen and tinted the same color as well, but i do plan on supporting larger/custom screen sizes later on

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: BasiC++
« Reply #5 on: December 24, 2009, 03:09:54 pm »
ah ok sweet!
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: BasiC++
« Reply #6 on: December 24, 2009, 03:13:52 pm »
cool, I would like this. Due to my old skoolness I would most likely use 320x240 a lot

Offline miotatsu

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 332
  • Rating: +11/-1
    • View Profile
Re: BasiC++
« Reply #7 on: December 24, 2009, 03:32:56 pm »
yeah, just keep in mind that if you use a custom screen i won't have support for commands that use the pixel array because it will be based off of the original calc dimensions or a direct multiple of said dimensions, but because a custom screen size most likely would not be a multiple of the original dimensions the pxl commands would not work properly and thus need to be disabled, this is made upf ro by the fact that it will have support for custom sprites and image loading (or at least this is what i plan on having)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: BasiC++
« Reply #8 on: December 24, 2009, 03:38:47 pm »
would it still work with real(1/2 commands, though? It would be cool to still be able to use sprites and tilemaps regardless of the screen dimensions (8x8 or 16x16)

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: BasiC++
« Reply #9 on: December 24, 2009, 03:38:51 pm »
hmm, could you design a command like the pixel command? like a custompxl? so it works with the custom screensize?

also how soon do you think there will be an alpha/beta release?
« Last Edit: December 24, 2009, 04:40:37 pm by Eeems »
/e

Offline miotatsu

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 332
  • Rating: +11/-1
    • View Profile
Re: BasiC++
« Reply #10 on: December 24, 2009, 04:43:04 pm »
i may make a custompxl command but right now its not on the top of the list of things to get done :P however right now i am having a rather strange issue, i created a simple system to load a generic file and interact with its contents, strangely tho it will not open the file, here is the code:
Code: [Select]
#include <iostream>
#include <fstream>
#include <string>


using namespace std;

ifstream file;
string Filename;

void run();

int main (int argc, char *argv[])
{
if (argc == 2){
string Filename = argv[1]; }
run();
cin.get();
return 0;
}

void run()
{
string line;
file.open(Filename.c_str());
if (file.is_open())
{
while (! file.eof() )
{
getline (file,line);
cout << line << endl; }
file.close(); }
}
what this is supposed to do is you drag a text file (with text in it) onto the exe and it outputs the contents of it into the console window, however when a file is dragged onto it the console opens as it should, but no text is output-ed (the file fails to load) 

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: BasiC++
« Reply #11 on: December 24, 2009, 04:52:11 pm »
hmm, I wish I could help, but I don't know what language you are using...
/e

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: BasiC++
« Reply #12 on: December 24, 2009, 04:59:33 pm »
It looks like C++. Is it?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: BasiC++
« Reply #13 on: December 24, 2009, 05:03:08 pm »
I think this is his project parts of source code, not actual code it can interprets

Offline miotatsu

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 332
  • Rating: +11/-1
    • View Profile
Re: BasiC++
« Reply #14 on: December 24, 2009, 05:29:13 pm »
this is just some example code in C++ of what im trying to get my Interpreter to do, the interpreter is supposed to open a file with BasiC++ code in it, rip lines of code out of it and do something based on the code it ripped, this example program demonstrates that it is failing to open the file for an unknown reason, basically you can consider that code i posted as a source of an example interpreter, what i'm working on right now is trying to get that program to successfully open a file, if i can do that i will be able to get back to working on BasiC++ commands