Join us on Discord!
You can help CodeWalrus stay online by donating here.
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - semiprocoder

#226
Contests / Re: CWick Contest #1: 140 characters
September 25, 2015, 03:53:57 AM
I have been trying to make something in lua for the nspire for hours now. I could not make anything at all that came even close to 140 bytes in source size. Anyways, I look forward to the next competition. Hopefully I will be able to do something.
#227
Contests / Re: CWick Contest #1: 140 characters
September 25, 2015, 02:30:51 AM
Does the 140 bytes include any images that my code relies on and loads. Otherwise I will just draw rectangles or something.
#228
How do you use TISDCC cause I tried a while ago and couldn't get it working.
#229
Contests / Re: CWick Contest #1: 140 characters
September 25, 2015, 12:11:52 AM
nspire lua is not agreeing with this limit. function on.paint(gc) and gc:drawRect themselves take up over 30 characters. That is without arguments for drawRect and end for on.paint. Then there is on.activate and on.timer. This is going to be quite difficult.
#230
Contests / Re: CWick Contest #1: 140 characters
September 24, 2015, 08:01:01 PM
Finally a contest. I was waiting for one of these. I will definately do something for this, if I get a good idea for it.
#231
Calc Projects, Programming & Tutorials / Re: Nspire Flow
September 23, 2015, 03:21:22 AM
well, honestly for the web being slower I now for sure about the loading part but I am not sure about performance. It is just what I've heard and read. Also flow doens't really provide any information on its main page in the android game page, so I have no idea how to check whether I could use the levels. I am going to try emailing them but I am not sure how I would explain my situation.
#232
Calc Projects, Programming & Tutorials / Re: Nspire Flow
September 23, 2015, 02:29:33 AM
Nah, I think java is just too slow to be put into a web browser. It takes too long too load and its not that easy to load in huge libraries because you would have to load it in every time you visit the browser. But yeah, standalone java programs are pretty good.

Also should I just copy the levels from the original flow in android, because I am having too much of a hard time coming up with levels.
#233
Quote from: SiphonicSugar on September 22, 2015, 08:33:14 PM
Oh yeah, another depressing thing. (Sorry to mention it but I feel like I should) I keep finding topics and threads here and on Omnimaga especially about RPGs that people are going to make.  They all seem like really good ideas, but the creators just drop the idea or something because they have not posted about it in like a year.

This is kind of off topic here, but have there ever been any rts games made for any calc(specifically ti 84 plus or ti nspire cx non ndless cause those are the ones I have).

Also I think that ti nspire basic isn't too hard, there are just not many good tutorials for it. And besides, I think that you don't necessarily need to learn basic, you can just go straight to lua and for it there are some really nice concise tutorials for it and a nice api functions list, which can be improved but are still really nice. It took me about 2 hours to learn, and even though I have programmed in c and java before, I have never really programmed in a scripting language, and I think it would be relatively easy to learn nevertheless.

But the thing about people having stuff better to do is totally true. In my school I showed off the simple lua games I made and some people liked them, while others just asked something along the lines of "why do this if you have a smartphone?"
#234
Calc Projects, Programming & Tutorials / Re: Nspire Flow
September 21, 2015, 01:31:00 AM
Well there's always processing.js but its impossible to implement and its in JavaScript, which I don't know yet, but it works for simple programs pretty well. And since its JavaScript all browsers pretty much support it.

EDIT: I now have a main menu where you select the level pack. Only 5 by 5 and 8 by 8 do anything though. 5 by 5 still has 10 levels but 8 by 8 has 5 levels now, but I apologize if the levels are too easy; I am not that good at making levels.

Also I updated my level making program so that you can kind of play it. You press the right arrow to go into play mode and then click on one of the circles and click anywhere where there is nothing. It will place a smaller circle representing path of the same color on that square. When you press left arrow it resets back to level editing:


int board[][]=new int[8][8];
int playBoard[][]=new int[8][8];
int boardSize=8;//change this for different board sizes
int X=0;
int Y=0;
int maxNum=12;
boolean play=false;
int prevX=-1;
int prevY=-1;
import java.util.Arrays;
void settings(){
  size(800,800);
}
void setup(){
  board=new int[boardSize][boardSize];
  playBoard=new int[boardSize][boardSize];
  for(int i=0;i<boardSize;i++){
    for(int j=0;j<boardSize;j++){
      board[i][j]=0;
    }
  }
}
void fillColor(int i, int j){
  int temp;
  if(!play)
    temp=board[i][j];
  else
    temp=playBoard[i][j];
  if(temp>maxNum)
    temp-=maxNum;
  switch (temp) {
        case 1: fill(255, 0, 0);
          break;
        case 2: fill(0, 0, 255);
          break;
        case 3: fill(0, 255, 0);
          break;
        case 4: fill(255, 255, 0);
          break;
        case 5: fill(255, 128, 0);
          break;
        case 6: fill(0, 255, 255);
          break;
        case 7: fill(128, 0, 0);
          break;
        case 8: fill(0, 128, 0);
          break;
        case 9: fill(255, 30, 128);
          break;
        case 10: fill(128, 15, 128);
          break;
        case 11: fill(128, 128, 128);
          break;
        case 12: fill(255, 255, 255);
          break;
        default: fill(0, 0, 0);
          break;
      }
}

void mouseClicked(){
  if( !play){
  if(board[X][Y]<maxNum)
    board[X][Y]+=1;
  else
    board[X][Y]=0;
  for(int i=0;i<boardSize;i++){
    for(int j=0;j<boardSize;j++){
      if(board[i][j]>0)
        print(Integer.toString(board[i][j]*2-1));
      else
        print(Integer.toString(0));
      if(j<boardSize-1)
        print(",");
    }
    print(" ");
  }
  println();
  }
  else{
    if(playBoard[X][Y]==0 || playBoard[X][Y]>maxNum){
      if(X>=0 && X<boardSize && Y>=0 && Y<boardSize){
        if(playBoard[X][Y]==0 && prevX>-1 && prevY>-1)
          playBoard[X][Y]=board[prevX][prevY]+maxNum;
      }
    }
    else{
      prevX=X;
      prevY=Y;
    }
  }
}

void draw(){
  fill(0,0,0);
  rect(0,0,width,height);
  stroke(250,255,255);
  for(int i=0;i<=boardSize;i++){
    line(0, i*height/boardSize, width, i*height/boardSize);
    line(i*width/boardSize, 0, i*width/boardSize, height);
  }
  X=mouseX*boardSize/width;
  Y=mouseY*boardSize/height;
  for(int i=0;i<boardSize;i++){
    for(int j=0;j<boardSize;j++){
      noStroke();
      if(!play){
        fillColor(i,j);
        ellipse((4*i+2)*width/boardSize/4, (4*j+2)*height/boardSize/4, width/boardSize/2, height/boardSize/2);
      }
      else{
        if(playBoard[i][j]>0 && playBoard[i][j]<=maxNum){
          fillColor(i,j);
          ellipse((4*i+2)*width/boardSize/4, (4*j+2)*height/boardSize/4, width/boardSize/2, height/boardSize/2);
        }
        else{
          fillColor(i,j);
          ellipse((4*i+2)*width/boardSize/4, (4*j+2)*height/boardSize/4, width/boardSize/4, height/boardSize/4);
        }
      }
    }
  }
}
void keyPressed(){
  if(keyCode==RIGHT){
    play=true;
    for(int i=0;i<boardSize;i++){
      for(int j=0;j<boardSize;j++){
        playBoard[i][j]=board[i][j];
      }
    }
  }
  if(keyCode==LEFT){
    play=false;
  }
}
#235
Calc Projects, Programming & Tutorials / Re: Nspire Flow
September 20, 2015, 03:35:05 AM
So I made all the code that I need to add levels. Now all I need it so add strings, so I wrote a small program in processing(which is pretty java without full classes, only subclasses and that has a simple graphic library built into it, unless run in eclipse) for that purpose

It just draws a board and when you click on a square the circle changes colors. It rotates colors, so you can go around. Every time you click the mouse to change a color it outputs the string to make that sequence of colors to the console. I know this is not the best way of output, but I just wanted to make the code short. This is source code, so to run it you need to download processing itself and then compile the code with processing(or you could do it in eclipse and include processing but for simple projects that is annoying). To change the board size, all you need to need is change the boardSize variable in the third line. It currently has 12 colors, so only up to 10x10 or maybe 11x11, but not much more.

If anyone reading this has any skill in making these kinds of puzzles, could you please make me some levels and reply with the strings for the levels. I plan to have 50 5x5, 50 8x8, 50 10x10, and random other sizes. I will mention you in the readme but I honestly don't think that really matters but still.

Anyways, here is the processing code:


int board[][]=new int[8][8];
int boardSize=8;//change this for different board sizes
int X=0;
int Y=0;
int maxNum=12;
import java.util.Arrays;
void settings(){
  size(800,800);
}
void setup(){
  board=new int[boardSize][boardSize];
  for(int i=0;i<boardSize;i++){
    for(int j=0;j<boardSize;j++){
      board[i][j]=0;
    }
  }
}

void mouseClicked(){
  if(board[X][Y]<maxNum)
    board[X][Y]+=1;
  else
    board[X][Y]=0;
  for(int i=0;i<boardSize;i++){
    for(int j=0;j<boardSize;j++){
      if(board[i][j]>0)
        print(Integer.toString(board[i][j]*2-1));
      else
        print(Integer.toString(0));
      if(j<boardSize-1)
        print(",");
    }
    print(" ");
  }
  println();
}

void draw(){
  fill(0,0,0);
  rect(0,0,width,height);
  stroke(250,255,255);
  for(int i=0;i<=boardSize;i++){
    line(0, i*height/boardSize, width, i*height/boardSize);
    line(i*width/boardSize, 0, i*width/boardSize, height);
  }
  X=mouseX*boardSize/width;
  Y=mouseY*boardSize/height;
  for(int i=0;i<boardSize;i++){
    for(int j=0;j<boardSize;j++){
      noStroke();
      switch (board[i][j]) {
        case 1: fill(255, 0, 0);
          break;
        case 2: fill(0, 0, 255);
          break;
        case 3: fill(0, 255, 0);
          break;
        case 4: fill(255, 255, 0);
          break;
        case 5: fill(255, 128, 0);
          break;
        case 6: fill(0, 255, 255);
          break;
        case 7: fill(128, 0, 0);
          break;
        case 8: fill(0, 128, 0);
          break;
        case 9: fill(255, 30, 128);
          break;
        case 10: fill(128, 15, 128);
          break;
        case 11: fill(128, 128, 128);
          break;
        case 12: fill(255, 255, 255);
          break;
        default: fill(0, 0, 0);
          break;
      }
      ellipse((4*i+2)*width/boardSize/4, (4*j+2)*height/boardSize/4, width/boardSize/2, height/boardSize/2);
    }
  }
}


Also DJ omninaga I think I fixed the crashing bug, because I didn't check for a nil statement of one of my variables. But when you click an empty square your previous line draws erases.
#236
I don't know, but I think that the first option is better, but I think that if you made the icons upscaled 3 or so times, so that it is harder to misclick, the second option could be better without any real changes.
#237
I know I probably sound really stupid saying this, but how do you get a rom for the emulator. I can't figure it out.
#238
Calc Projects, Programming & Tutorials / Re: Nspire Flow
September 17, 2015, 02:12:53 AM
I don't see any right now but I had some crash that I couldn't explain before, so there might still be some crashes still, but they are rare because I don't know how it happened and I could not reproduce it. Maybe it was a test before I finished and I didn't realize, bu I am pretty sure that it happened after I finished bugfixing. I might be wrong about the bugs though. I hope so, obviously. I plan to have around 50 5 by 5 levels, 50 8 by 8, and 50 10 by 10, with some random other levels in between and maybe some up to like 16 by 16(if the nspire has enough pixels for that).
#239
Calc Projects, Programming & Tutorials / Re: Nspire Flow
September 17, 2015, 01:17:38 AM
Now there are ten levels, and you press enter to advance through the levels. They are copies of the first ten levels of flow for android. Once I get the level editor up and running, I shall probably make some of my own levels.

Flow should now work for any api level now, because I set the api level. I also fixed some annoying bugs that I had before(not all though).
#240
Yeah thanks I really like codewalr so far and I like watching all the forums. Currently I am not really active in any other threads but I still read them. Also I just posted flow for the nspire. I hope you like it. It should work on any os version with lua because it doest use images.
Powered by EzPortal