Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411427 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 11:34:16 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The happy programmer room
Pages: 1 ... 191 192 [193] 194 195 ... 279
Print
Author Topic: The happy programmer room  (Read 677770 times)
indie11
Level 2
**


View Profile
« Reply #3840 on: September 07, 2014, 07:28:25 PM »

What seems to be wrong is the hold jump's feeling, try walljumping in the opposite direction and doing a long jump. It feels as if I was being pulled upwards at a constant velocity instead of a higher velocity. Along with that walls should only stick when you are moving towards them

you meant to say that the upward gravity shouldn't be constant for long jump?
Any idea how its done in super meat boy? Because the player goes up in a linear graph fashion, I don't see that in mine  Undecided
« Last Edit: September 07, 2014, 07:45:30 PM by indie11 » Logged

Geti
Level 10
*****



View Profile WWW
« Reply #3841 on: September 07, 2014, 10:34:23 PM »

If you use the following structure

//*/
  Code A (active)
/*/
  Code B (inactive)
//*/

you can toggle between codes A and B by deleting the first '/'  Wink Try it out!
Using the preprocessor is 100x cleaner than this tbqh :^)
Logged

Sik
Level 10
*****


View Profile WWW
« Reply #3842 on: September 08, 2014, 03:00:18 AM »

Also that has the advantage that you can define preprocessor constants from the command line when invoking the compiler (and IDEs let you do this stuff). This means you wouldn't even need to touch the code to change it (heck, you could even do two separate builds with each path simultaneously!).
Logged
Geti
Level 10
*****



View Profile WWW
« Reply #3843 on: September 08, 2014, 03:08:12 AM »

(we _do_ do separate builds with each path simultaneously for platform specific stuff)

Also, I designed and implemented a 2d interpreted language today.

Here's an infinite loop of adding 2 ascii numbers together, decrementing the result, deleting that, and starting over.

Demonstrates concurrency, conditionals, data pointer routing and general code flow - need to get jumps and a few other goodies in too. Doesn't show self modification, but since the data and code space are shared, it's possible (but fiddly).

...Yes, it's yet another fiddly esolang, though I'm planning to add some more stuff to aid usability, and I'm trying to reduce the number of idiot restrictions where I can.

This is running at 10hz to show what's going on; need to get direction indicators for the threads going but have to do other stuff tonight as well, haha.
Logged

bateleur
Level 10
*****



View Profile
« Reply #3844 on: September 08, 2014, 03:16:34 AM »

<applause>

That's awesome! TigerHand Thumbs Up Right
Logged

jgrams
Level 3
***



View Profile
« Reply #3845 on: September 08, 2014, 09:50:25 AM »

Haha, I sat there stepping through that GIF for way too long. Cute. I still don't understand what the colons do, though. Just skip a space to allow you to visually separate blocks of code?
Logged
standardcombo
Level 8
***


><)))°>


View Profile
« Reply #3846 on: September 08, 2014, 11:54:13 AM »

Yes I know about pre-processor flags, but that's besides the point. Its funny because interaction emerges from syntax.
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #3847 on: September 08, 2014, 06:04:41 PM »

Thanks Bateleur!
Haha, I sat there stepping through that GIF for way too long. Cute. I still don't understand what the colons do, though. Just skip a space to allow you to visually separate blocks of code?
Yup they just skip a space, but that allows jumping over operations on overlapping branches, as well as speeding up "empty" loops (double speed). I'm actually thinking about adding something for longer jumps "across" blocks of code, as well as perhaps some jumps on the data counters, routing is currently the main annoyance.
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3848 on: September 08, 2014, 06:21:52 PM »

Hey great stuff geti, I've always wanted to make a 2d language, and this looks pretty nifty. With self-modifying code and mutation you could run a Tierra-like experiment, if you're into ALife that is. I image something like Langton's Loops could emerge.. Smiley
Logged

Garthy
Level 9
****


Quack, verily


View Profile WWW
« Reply #3849 on: September 09, 2014, 01:39:04 AM »


I haven't been able to post for a bit, but a quick one:

standardcombo: Just wanted to let you know that your comment trick gave me a laugh- it's very clever and deliciously obtuse.

Geti: That image is beautiful. For routing, how about a left bracket that jumps to the corresponding right bracket in the current direction of travel, with nesting allowed. Perhaps ordinary brackets for left/right, and curly for up/down, so that the two don't interfere with each other.
Logged
Adam_
Level 1
*



View Profile WWW
« Reply #3850 on: September 09, 2014, 03:26:47 AM »

Also, I designed and implemented a 2d interpreted language today.

Impressive, in a fun way Smiley That animated gif you've posted is kind of mesmerizing.
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #3851 on: September 09, 2014, 05:38:12 AM »

@Adam_ I'm glad I made the gif, people seem pleased with it Smiley

@Garthy: yeah I'm thinking brackets would be a natural syntax for jumps; not sure I'd bother splitting horizontal and vertical. Food for thought.

@eigenbom: yeah I've thought about plugging in a genetic algorithm but not sure what the metric for success would be Smiley would have to seed it with useful starting code/patterns and make the mutation ops aware of the semantics to some degree I think.
Logged

standardcombo
Level 8
***


><)))°>


View Profile
« Reply #3852 on: September 09, 2014, 08:45:57 AM »

Does it really have to be aware of semantics? If there is 'dead' code lying around it does nothing right? Mutations are most likely generating dead code, or breaking the code and killing the individual. Until at some point it makes a successful random code, probably a bit less efficient than the previous one, but still ok. That new piece then becomes something awesome later. Isn't that evolution?
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #3853 on: September 09, 2014, 02:44:45 PM »

Sure, but this stuff isn't exactly as cheap to evaluate as a N queens solution or whatever Smiley capping the execution to N steps (including steps of each thread individually) would stop that and avoid running afoul of the halting problem but again, how do you measure fitness of a program like this?
Logged

standardcombo
Level 8
***


><)))°>


View Profile
« Reply #3854 on: September 09, 2014, 03:49:38 PM »

Create a problem for it to solve?
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3855 on: September 09, 2014, 04:16:20 PM »

In Tierra, iirc, the mutations just change the instructions randomly and the fitness is related to the amount of CPU time a segment of code gets, or the length of the program or something. You seed a space with some predesigned basic things, and then let them mutate and compete with each other. The Tierra paper will have the specifics of how they did it, but it was a linear space and 2D is going to be a lot more difficult to get fitness-increasing mutations. You may need (as you say) to have your basic elements be little geometric configurations of instructions, rather than single cell instructions. It still would be a fun little experiment, I did some evolutionary algorithm stuff a few years back, and it is often surprising at the things that pop out. Tierra is famous for having "parasites" evolve, programs that hijack the run loop of other programs to replicate themselves.

Edit: Von Neumann's universal replicator also just fell into mind. I think your primitives are more capable than his, so a replicator wouldn't be as involved in your system as it is in his. The replicator could be your seed in an evolutionary experiment, and then introduce point mutations during the replication process.
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #3856 on: September 09, 2014, 07:51:22 PM »

@eigenbom: I think I'd want a simple "register" per data cursor for self-replication; stepping forward and back to avoid clobbering adjacent data while doing the usual add/sub stuff sounds slow and ugly and annoying to ensure you weren't moving anything that was executing, though I guess it'd be possible with some sort of symmetrical 2 stage execution scheme... Can't use the current data move/copy instructions while preserving the original program in place because it'll drag the program "through" itself.

Registers would actually make binary operations simpler and more intuitive to model, might be able to move things like conditionals into a binary op model and reduce the need for 2 program cells/complex instructions. instead of "? " you'd load space into the register and compare as needed. Ideas for fiddling later, as I've been most frustrated with those comparisons so far.

Re: parasites - I dunno if I'd want unrelated programs sharing memory space, haha. I guess you could easily have 2 programs "evolving" within the same program with a fork into both from the entry point, but multiple entry points currently just take the latter, to avoid the possibility for 64k threads being allocated at start time and all of them going into an infinite loop. Considering there's no stack it's not very expensive per thread so might consider multiple entry points.

@standardcombo: I understand that a common approach in GA is to randomly mutate data, but for something like this that's expensive to evaluate and reasonably space intensive compared to many GA targets I wouldn't want to take a wasteful approach and risk never seeing anything good come of it.

Measuring the "amount" something has solved that problem is problematic. I guess it could be based on I/O instead of memory semantics perhaps, and be some sort of parsing task (count/validate matching braces problem or something).
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3857 on: September 09, 2014, 08:26:47 PM »

Yeah a register or stack could be good, but you already have read/write memory. A separate register would just be an extra primitive/concept, but you're right in thinking that it would make things much easier. You could also have a form of memory protection by restricting the distance of write/jump instructions, or having cells that block things jumping through them etc. Haha, it's sounding more like an organism than a machine. Anyway, at the end of the day there's about 30 years of research in this area, and I'm sure they've covered all of these basic things. If you're interested at all, go chat to my old supervisor, Jon McCormack, at Monash Caulfield, he's very familar with ALife, but mostly wrt digital art.
Logged

TheLastBanana
Level 9
****



View Profile WWW
« Reply #3858 on: September 09, 2014, 10:20:46 PM »

On the topic of esolangs, I just finished an implementation of a programming language made up entirely of ASCII art of churros.

Hello world:
Code:
{o}==========} {==={*} {o}} {======{o} {o}=} {={o} {o}} {====={o} {o}=}
{======{o} {o}===} {={o} {o}=} {====={o} {o}==} {======{o} {o}=======} {={o}
{o}==} {====={o} {o}===} {======{o} {o}=========} {={o} {o}===} {====={o}
{o}====} {======{o} {o}==========} {={o} {o}====} {====={o} {*}=} {={o} {===={*}
{{o} {o}==} {======{o} {o}==} {={o} {========{o} {o}====} {======{o} {o}=} {={o}
{========{*} {o}=======} {={o} {========{*} {========{*} {o}===} {={o}
{========{*} {o}=} {======{o} {o}==} {={o} {========{o} {o}===} {======{o}
{*}===} {={o} {========{o} {========{*} {o}===} {={o} {========{*} {*}======}
{={o} {========{*} {*}========} {={o} {========{*} {o}=} {======{o} {o}===}
{={o} {========{o} {o}} {======{o} {========{*}

I was working with a lot of Brazilian programmers over the summer, and I can't count how many times they brought up churros... I couldn't help it. Cheesy

It was mostly an excuse to get some Haskell practice in anyway. Using Parsec was a hell of a lot more enjoyable than my last parsing experience which involved magical C++ template meta-programming with Boost.Spirit.
Logged
Geti
Level 10
*****



View Profile WWW
« Reply #3859 on: September 09, 2014, 11:30:47 PM »

Yeah a register or stack could be good, but you already have read/write memory.
Yup, but no way to easily pick things up and move them elsewhere without tedious "? -ss+bb" type constructs like brainfuck whenever you need to jump over something.
Jon McCormack, at Monash Caulfield
Might look him up if I get a free hour here or there, thanks Smiley

@TLB: looks delicious Smiley nice to see you around, as always.
Logged

Pages: 1 ... 191 192 [193] 194 195 ... 279
Print
Jump to:  

Theme orange-lt created by panic