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.


Messages - Jim Bauwens

Pages: 1 ... 9 10 [11] 12 13 ... 125
151
Computer Projects and Ideas / Re: Random Script Snippets
« on: May 10, 2013, 01:26:08 pm »
Here is something I did in my spare time in C#. It's not really a snippit, but fun anyway^^

Main.cs - Main program code
Code: [Select]
using System;

namespace Fractal
{
class MainClass
{


public static void TriLine(double distance, Turtle myTurtle)
{
Console.ForegroundColor = ConsoleColor.Magenta;
if (distance < 1)
{
myTurtle.Forward(distance);
}
else
{
TriLine (distance/3, myTurtle);
myTurtle.Left (60);
TriLine (distance/3, myTurtle);
myTurtle.Right (120);
TriLine (distance/3, myTurtle);
myTurtle.Left (60);
TriLine (distance/3, myTurtle);
}
}

public static void Main (string[] args)
{
Console.WriteLine ("Press any key to start");
Console.ReadLine ();

Display myDisplay = new Display ();
Turtle myTurtle = new Turtle (myDisplay);



//myTurtle.HomeXPos = 10;
myTurtle.HomeYPos = 10;

for (int i = 0; i < 3; i++) {
TriLine(300, myTurtle);
myTurtle.Right(120);
}

myDisplay.UpdateDisplay ();

}
}
}

Turtle.cs - Turtle 'engine'
Code: [Select]
using System;

namespace Fractal
{
public class Turtle
{
public double XPos  {get; set;}
public double YPos  {get; set;}
public double Angle {get; set;}

public bool Pen {get; set;}

public double HomeXPos  {get; set;}
public double HomeYPos  {get; set;}

private Display myDisplay;

public Turtle(Display myDisplay)
{
XPos = 0;
YPos = 0;
Angle = 0;

Pen = true;

this.myDisplay = myDisplay;

HomeXPos = myDisplay.Width / 2;
HomeYPos = myDisplay.Height / 2;
}


public static double DegToRad(double deg)
{
return deg * Math.PI / 180;
}



public void Forward(double distance)
{
double oldX = XPos;
double oldY = YPos;
double angle = DegToRad(this.Angle);

YPos = oldY + distance * Math.Cos(angle);
XPos = oldX + distance * Math.Sin(angle);

if (Pen)
{
myDisplay.DrawLine (
(int) Math.Round(HomeYPos + oldY),
(int) Math.Round(HomeXPos + oldX),
(int) Math.Round(HomeYPos + YPos),
(int) Math.Round(HomeXPos + XPos)
);

//m
}

}

public void Left(double angleDelta)
{
Angle -= angleDelta;
}

public void Right(double angleDelta)
{
Angle += angleDelta;
}

public override string ToString ()
{
return string.Format ("[Turtle: XPos={0}, YPos={1}, Angle={2}]", XPos, YPos, Angle);
}
}
}


Display.cs - Allows you to draw to your console
Code: [Select]
using System;

namespace Fractal
{
public class Display
{
public const string PIXEL_ON = "\u2588\u2588";
public const string PIXEL_OFF = "  ";
public const int PIXEL_CHARS = 2;

public int Height { get; set; }
public int Width { get; set; }

public bool[,] DisplayBuffer;

public Display()
{
SetDisplay ();
}

public void SetDisplay ()
{
Width = Console.BufferWidth / PIXEL_CHARS;
Height = Console.BufferHeight - 2;

DisplayBuffer = new bool[Height, Width];

for (int i = 0; i < DisplayBuffer.Length; i++) {
DisplayBuffer [(int) i/Width, i%Width] = false;
}

}

public void SetPixel (int y, int x, bool state)
{
if (x > 0 && y > 0 && x < Width && y < Height)
DisplayBuffer [y, x] = state;
}

public void DrawLine(int x1, int y1, int x2, int y2) {
int w = x2 - x1;
int h = y2 - y1;

int dx1 = 0, dy1 = 0, dx2 = 0, dy2 = 0 ;

if (w<0) dx1 = -1 ; else if (w>0) dx1 = 1 ;
if (h<0) dy1 = -1 ; else if (h>0) dy1 = 1 ;
if (w<0) dx2 = -1 ; else if (w>0) dx2 = 1 ;

int longest  = Math.Abs(w) ;
int shortest = Math.Abs(h) ;

if (!(longest>shortest)) {
longest = Math.Abs(h) ;
shortest = Math.Abs(w) ;
if (h<0) dy2 = -1 ; else if (h>0) dy2 = 1 ;
dx2 = 0 ;           
}

int numerator = longest >> 1;

for (int i=0; i<=longest; i++) {
SetPixel(x1 , y1, true) ;
numerator += shortest ;
if (!(numerator<longest)) {
numerator -= longest ;
x1 += dx1 ;
y1 += dy1 ;
} else {
x1 += dx2 ;
y1 += dy2 ;
}
}
}

public void UpdateDisplay()
{
Console.SetCursorPosition (0, 0);

for (int y = 0; y < Height; y++) {
for (int x = 0; x < Width; x++) {
string pixel = DisplayBuffer[y, x] ? PIXEL_ON : PIXEL_OFF;
Console.Write (pixel);
}
Console.WriteLine ();
}
}

}
}


Now, here is what it looks like:

Of course, I set my terminal to have very very many rows and columns so I can simulate pixels. (however you can change the code to work on a 'lower' resolution)

152
Miscellaneous / Re: Achievement ! Get featured by TI :D
« on: May 07, 2013, 04:14:02 pm »
Hah, nice nice  ;D

153
Other Calculators / Re: TI NSpire CX CAS VS HP Prime CAS
« on: May 04, 2013, 07:16:54 am »
Where does the Nspire CX CAS have better CAS than the 89? I'd honestly like to know this.

It's also important to note that the CAS software on the Nspire evolved from the CAS on 68k systems.

Regarding the HP Prime vs the TI-Nspire CAS, the Nspire has a lot more backing of teachers and there is an incredible amount of activities you can download.

154
Make sure the place has enough sleeping places for those who want to hang out late night and/or can't afford a hotel.

You make a good point here, I actually haven't thought about this. Will need to think about the possible solutions about this :)

As far the location, at the moment Belgium/France seems the best bet (for most members). But of course the expense of traveling is big problem. I understand that this is a big problem for most people.
But without traveling, there isn't really going to be a big meeting.

Maybe we could have meetings for different countries at the same time, have a big video conference together (project/display). That would be interesting too.

155
This has been something on my mind for some time now, so I thought it would be best to organize a poll about it.
Would you be interested in joining a calculator event in Europe if it would be big enough? The calculator community is huge, and as far as I know there haven't been big meetups before. Having a large meeting will benefit the community and can be a very interesting experience.

This is a serious question, because I'm willing to organize something if I get enough positive responses. I don't have any big plans yes, just want to know your guys opinions :)

Cemetech thread: http://www.cemetech.net/forum/viewtopic.php?p=203922#203922

156
News / Re: Mini vMac for the TI-Nspire
« on: April 15, 2013, 09:21:14 am »
How can I open and edit AppleScripts on this emulator?

From wikipedia: AppleScript was released in October 1993 as part of System 7.1.1
I suppose if you have system 7.1.1 running, yes. (the one included is 7.0.1).

157
News / Re: Mini vMac for the TI-Nspire
« on: April 14, 2013, 04:27:21 pm »
Just do MS-DOS, I bet that that could run on a potato.
But not on an apple ;) If you guys are interested in porting DOS or an emulator such as DOSbox, you should start a new thread about it. This topic isn't really the place for it :)

158
News / Re: Mini vMac for the TI-Nspire
« on: April 14, 2013, 12:22:25 pm »
Augs,
When the OS has started, press TAB one time. Then pressing 5 will act as a mouse click. The other can also be used to control the mouse.

Floris: It's a lot of work to do that, so I'll see.

159
Other Calculators / Re: Your calculator collection
« on: April 14, 2013, 06:32:09 am »
What happened to the one in the bottom right (83+?) It looks like someone stabbed the screen D: Nice collection though :)

It actually doesn't have a display anymore. It's a headless calc now ^^
I've got it from a friend, no idea what happened to it. The screen was all cracked, I just removed it.

erm, is the 89+ all on the bottom only the case without the actual calc? O.O
It's a TI-92 Plus without mainboard. I got the mainbord still though, and it's still functional. I broke the screen of it during the 2006 TI-Freakware contest.

160
News / Re: Mini vMac for the TI-Nspire
« on: April 14, 2013, 06:06:08 am »
Hi, I tried to use the following disk : http://www.mediafire.com/?nmymty24z5t
Not only didn't it work, but also the file can't be deleted anymore.

Well, at the moment my port can open only one disk image. That image has to have a system folder in it, in order to boot. But it doesn't, and that is why it fails.
Install Mini vMac on your computer, and drag the system.dsk onto the emulator (so it will boot), and then drag the 1988.dsk image on it. You will see two floppies on your desktop, and now you could for example copy the system folder to the 1988.dsk.
Then shutdown your emulator. Now you should be able to get that disk working on your handheld.

Regarding the problem that you can't delete the file, try rebooting your Nspire. It might be that the disk is still seen as in use.

Few problems I have encountered:
Figuring out how to use drop down menus is a hassle.
You need to keep clicking while dragging through the menu's. I recommend you to press 'tab' to toggle numpad control for the mouse. Then you can use the touchpad to move the mouse, and 5 to click.

There is no "controls" section of the help.

Well, it does mention that you can use TAB to toggle numpad control, and ctrl to access the menu. The controls of Mac System 7 are out of the scope of the readme, it doesn't belong to the emulator.

Rebooting/shutting down and turning back on causes the system to be unable to locate/read/initialize it's disk image. So rebooting is a nono.
When rebooting, System 7 ejects the disk. So when boot again, the disk will be gone. So this is perfectly normal behavior. I'll see if I can add a menu to mount disk images. That will always be handy.

There are no save states, and instead of control, I suggest using a button like docs to pull up the emulator controls.
Well, I need to see if DOC allows you to press other keys simultaneously. If it does, then I'll definitely do the switch.

Darn this is cool. I wonder if it's legal to distribute, though? Or has it become abandonware over the years?

I could always remove the disk and rom image if it could present problems (although I don't think so, for example os 7.0.1 is freely available). It would just be harder though for new users.

By the way, does this include all 7.x systems and would it be able to run softwares from a Flash Drive like Linucx? Because Starcraft can run on Mac System 7.6 so I wonder if it could actually run it? O.O I suppose the fact that old versions requires the CD might be seriously problematic, though, unless there's a way to make a Flash drive act like a CD drive and have a game read from it.
Normal all 7.x (and previous versions) should boot. However, there are PowerPC versions and 68k versions. This emulator is for 68k (68000 specifically), so you need to see if the software supports that. As for USB disk support, that's quite hard .. but it is possible with very very much work ;P

161
News / Re: Mini vMac for the TI-Nspire
« on: April 13, 2013, 01:59:46 pm »
@Dapianokid, Stefan and I are brothers ^.^

I still need to work a bit on improving the speed, as that dropped slightly (although it's still very usable) when adding touchpad mouse control support.

162
News / Re: Mini vMac for the TI-Nspire
« on: April 13, 2013, 01:42:20 pm »
If you don't believe it, why not download and try it? ;)

163
News / Re: Mini vMac for the TI-Nspire
« on: April 13, 2013, 01:06:38 pm »
Update everyone, there is a new version that has touchpad support! :D
Now you can move the mouse easily around.

Edit: (there is a ROM file in it.. isn't that illegal??)
As far as I understand, this isn't illegal were it's hosted now.

Is there a way to make a bigger disk file? I'm having too much fun with this

http://minivmac.sourceforge.net/extras/blanks.html
Install Mini vMac on your computer, and migrate your disk to a bigger one (you can download empty disk images in the above link).

164
Other Calculators / MOVED: Mini vMac for the TI-Nspire
« on: April 13, 2013, 08:22:01 am »
This topic has been moved to News.

http://ourl.ca/18714

165
News / Re: Mini vMac for the TI-Nspire
« on: April 13, 2013, 08:20:24 am »
Very cool! ^^ Is there some reason you didn't put this in news?

Well, I wanted to wait and see what the others thought about it^^

it's definitely newsworthy :D

Also, any way to move the mouse faster ? :P
Well, as soon as I get the touchpad working ;P Currently the mouse moving is done by the OS itself, and I have no control over it. Although I could try some tricks ^^

Quote
(Also, can i haz HyperCard on it ?)
http://www.emaculation.com/forum/viewtopic.php?t=5700

Pages: 1 ... 9 10 [11] 12 13 ... 125