Alternatively, join us on Discord.
You can help CodeWalrus stay online by donating here.

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 - _iPhoenix_

1
Web / Re: Village
March 17, 2019, 11:34:36 PM
Well I've forgotten to post updates here and the language has completely changed so yay. Most recent update post.


I'm thinking of picking up this project again. I finally wrote documentation for Ask. I'm trying to keep the documentation understandable for someone with only a marginal programming ability (i.e. may have touched a C-based programming language or similar in the past or just started.)

I'm looking for feedback on this documentation (suggestions via post, ping, or PR are welcome!)

I'm also looking for clean (as clean as you can get with this language >.>) demo programs.

You can easily relocate your input (In lieu of input commands, I'm using the "modify this program with input values" technique) to the top of the program using Skip commands. I created a trivial multiplication program here. It's a model Village program, about as clean as it gets. I'm playing with the idea of named labels at some point, so that users viewing without line numbers don't have to count. You can just load it into the interpreter though.

Skip to line 22.
Note: ==========
Note: Trivial multiplication program
Note: Results: A*B -> output
Note: Author: _iPhoenix_
Note: ==========

Note: Inputs:
Note: =======

Note: MODIFY THIS LINE FOR A
Tell Ada to mine 16 stone.

Note: MODIFY THIS LINE FOR B
Tell Alan to mine 16 stone.

Note: =======

Tell Ken to write the text "waiting..." on his scroll.
Skip to line 40.

Note: Init:
Note: =====

Call for the villager named Ada.
Teach Ada how to mine stone.

Call for the villager named Alan.
Teach Alan how to mine stone.

Call for the villager named Ken.
Teach Ken how to mine stone.

Call for the villager named John.
Teach John how to mine stone.

Skip to line 9.

Note: Main program:
Note: =============

Tell Ken to mine 1 stone.
Tell Ada to double her stone.

Tell Alan to write the text "waiting..." on his scroll.
Tell Alan to write the text "waiting..." on his scroll.

Tell Alan to clear his scroll.

Tell Ada to give John half of her stone.

Ask Ken if he has less stone than Alan.
- If he does:
  + Skip to line 40.

Note: Output:
Note: =======
Tell John to write the amount of stone he has on his scroll.
Tell John to post his scroll to the Community Message Board.
2
Web / Re: UniChat!
January 04, 2019, 03:27:31 PM
Quote from: c4ooo on December 23, 2018, 02:08:08 AMEdit: also damn I didn't realize this project was started so long ago... time flies.

Yeah, it's really crazy. I remember writing this code and dealing with the problems... oh those were the days,indeed.
3
PC, Mac & Vintage Computers / Re: Golfed code snippets
December 08, 2018, 04:28:09 AM
As far as weird/cool constants in golfed code goes, this is my absolute favorite.

From the Quake III Arena source code, a routine to calculate an inverse square root
float Q_rsqrt( float number )
{
   long i;
   float x2, y;
   const float threehalfs = 1.5F;

   x2 = number * 0.5F;
   y  = number;
   i  = * ( long * ) &y;                       // evil floating point bit level hacking
   i  = 0x5f3759df - ( i >> 1 );               // what the f***?
   y  = * ( float * ) &i;
   y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
//   y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed

   return y;
}



From wikipedia
4
Other / Re: New member introductions: Say hello here!
December 05, 2018, 12:31:41 PM
Quote from: TruDev on December 05, 2018, 11:27:28 AM
Hi, I'm TruDev, and just being on this site has made me lose the game!

Ok, let's be serious...

I'm most active on Discord as TruDev#4528. I do happen to be on the CodeWalrus Discord, so message me there, I guess...

I own a TI-Nspire CX CAS because it is required by my school (best school supplies that are required btw).
I am making a Lua game for the TI-Nspire, actually! A post will be made soon, so you have something to look forwards to, I guess...

So this is the time where I wait for replies...

Nice to see you, TruDev! I don't own an Nspire currently, but I still look forward to seeing what you have created!
5
Other / Re: New member introductions: Say hello here!
December 05, 2018, 12:31:15 PM
Quote from: TruDev on December 05, 2018, 11:27:28 AM
Hi, I'm TruDev, and just being on this site has made me lose the game!

Ok, let's be serious...

I'm most active on Discord as TruDev#4528. I do happen to be on the CodeWalrus Discord, so message me there, I guess...

I own a TI-Nspire CX CAS because it is required by my school (best school supplies that are required btw).
I am making a Lua game for the TI-Nspire, actually! A post will be made soon, so you have something to look forwards to, I guess...

So this is the time where I wait for replies...

Nice to see you, TruDev! I don't own an Nspire currently, but I still look forward to seeing what you have created!
6
Drawing & Animation / Re: Walrii fanart
October 31, 2018, 01:31:13 PM
Happy Halloween, codewalrus!
7
Web / Village
October 15, 2018, 11:13:02 AM
So apparently I don't have a thread for my current project here. Dang.


Village is my long-term project. It's an Esolang where you are a village chief and you get to command people around and do things. It's a lot of fun.


Here's a basic "hello, world" program:
Call for the villager named Ada.
Tell Ada to write the text "Hello, World!" on her scroll.
Tell Ada to post her scroll to the Community Message Board



Pretty simple!


Villagers can have occupations.
Call for the villager named Alan.
Teach Alan how to gather wood.


Note: This next task takes 3 successful lines of code to complete.
Tell Alan to gather 20 wood.


Note: waste 3 commands.
Call for the villager named Ken.
Teach Ken how to draft blueprints.
Tell Ken to make a blueprint for a railroad to the North village.


Note: At this point, Alan's done getting wood.
Tell Alan to write the text "I have " on his scroll.
Tell Alan to write the amount of wood he has on his scroll.
Tell Alan to write the text " wood." on his scroll.
Tell Alan to post his scroll to the Community Message board.


Not all of the features are officially documented yet, with the main undocumented feature being Ask commands, aka conditionals. They are explained pretty well in my Cemetech topic:
large quote: ShowHide
QuoteSyntax: Ask [villager name] if [he/she] has [quantity] [item type].

That's a little weird, so here's an example: (Oh yeah, I added a female villager, Ada, named after Ada Lovelace)

Call for the villager named Ada.

Ask Ada if she has any stone.
- If she doesn't:
- Tell Ada to write the text "I do not have stone" on her scroll.
- If she does:
- Tell Ada to write the text "I have stone" on her scroll.
Tell Ada to post her scroll to the Community Message Board.


As you can tell, there are a few things going on here.
Call for the villager named Ada. makes Ada available for us to use. Because of my current crappy occupation-selecting script, she is an architect, but that doesn't really matter in this script.

Ask Ada if she has any stone.
This is the conditional statement. Of course, Ada does not have any stone. Only quarrymen can have stone.
The keyword any means more than one. You can also put a number in that conditional, and it will mean "greater than or equal to <number>".

Eventually, I will add the ability to use the word "exactly" before the number, but you can achieve this anyways with clever programming.

Because this is a conditional, we have to increase the indent level.

- If she doesn't:
- Tell Ada to write the text "I do not have stone" on her scroll.
- If she does:
- Tell Ada to write the text "I have stone" on her scroll.
This section of code is the conditional statement "body". The code in here is executed based on how the conditional happened.

[size=0pt]I see a rage coming from many programmers in here about what I am going to say in this section, but if you think about if statements in, say, JavaScript, the initial '{' can be viewed as a label to jump to, as can the '{' after the else.[/size]

- If she doesn't: and  - If she does:
Indent levels in village work like this:
<nothing>
-
  +
   *
    -
     +
      *
(and so on)


You don't need to memorize the pattern. If you get it wrong, the interpreter will kindly tell you which one to use.

The " -" before our command indicates that this is the first indent level. The space after the dash is a stylistic thing, it can be omitted.

The If she does: and If she doesn't: are labels that are jumped to if the condition is true or false, respectively. They can occur in any order. If there is only one of them in the conditional statement "body" and it doesn't apply, the entire conditional will be skipped.

If you run the code above, you will notice that only the text "I do not have stone" shows up on the output ("Community Message Board"). The other code beneath the If she does: label was skipped because it did not apply.

The end of any body section is always signified by a decrease in indentation.



There's more stuff in the docs.

Link to interpreter

The console messages (when debug mode is on) will help explain the examples and should help you.

Enjoy!
8

Attack of the Snails was accepted into the archives!


Check it out!


The source code is available on GitHub for your enjoyment (and pain), so go check that out if you have the time and endurance.
9

Here, have a public beta. You can download the current program from here!


Be sure to back you calc up (emulator highly recommended). There shouldn't be any major bugs, but my debugging/testing is in no way complete. also don't reverse-engineer my code from the decompiled binary unless you want a major headache, just wait for the source


You can find a features list somewhere above, I'm too lazy to write down everything I've done.


I'm not releasing my source just yet, I want to have the time to optimize by myself before all of my code is compressed down into some unimaginably tiny space.
10

So I unfortunately did not have time to work on this project for quite some time (family/irl stuff), but I've made good use of the time I had today!


I fixed the timing stuff and added the part of the animation that makes the snails fly out! Here, check it out:



half-way through the gif I'm like "this is never going to end x.x"


The gif shows off almost all of the features added so far, including the multiplier and how it gets reset if you run into anything. The game looks pretty sweet right now! I want to work on optimizations now, my code is getting quite large. My code is 1378 bytes from these additions, and after some optimizations I made during the writing of this post I got it down 20 bytes. I'm sure that with some more effort I could lop off more bytes.


This is really the first time I've been able to play the game, and it's a ton of fun. (I'm not saying this because I wrote it, either. I genuinely found it enjoyable) It's fast paced, but not too fast (for a while at least).


I might try to get the up and down animations more visible. I don't like how fast they are.


There's also a bit of a glitch in the beginning where it plays the animation sequence (you can't see it, but it's running the code) before it draws the snails, causing a uncomfortable wait. This is fixable and shouldn't take too long.
11
Today (well, yesterday as I am posting this), I worked on the above animations!

I'm no longer afraid of doing more complex graphics, because I actually can work through most of the problems I encounter which is super awesome. There are still problems that evade me, though, but I can usually get around them with a bit of refactoring and duck tape.

I'm not going to post the animation just yet (it's very much not done and extremely buggy), but it looks awesome even if it is sped up a good 700 times (not CEmu's fault) for reasons I can't discern... But if you step through the code while looking on the memory viewer, it's pretty nice.

I've decided that I'm going to optimize the program for size, considering that a significant portion of my code is dedicated to slowing the darn thing down so it's even visible. I'm down to 1295 bytes (code only, no sprites or font) right now, but there are numerous unnecessary jumps and several sections of repeated code.
12
Zarmina (Web/PC) / Re: Zarmina
August 18, 2018, 10:33:56 AM
I might as well plug my stuff if this is how we are doing it ;)

<plug>
I also do ambient tracks, like this, this, this, this, and (technically) this.

You can use any of this, and if you want anything custom it's free and done within a reasonable timespan.

</plug>

13
Mega-update (a.k.a. I forgot to crosspost, sorry)

I did all kinds of awesome things yesterday!

I eliminated all kinds of bugs that were present. This took a long time, as most of these bugs seemed to be caused by something that wasn't actually causing them. (i.e. all of the evidence pointed to my RNG routine modifying some internal variables, but it was actually because I deleted a few extra lines of code while trying to remove a comment).

I decided to make the menu options titlecase, only because I'm lazy and making them all uppercase would make me add 3 chars instead of 1 :)

I also added the code to draw in the multiplier. It pads the score to a length of 4, but I'm working on modifying my score-drawing routine so it only pads it to 2.

I also made the menu options functional! Before, both options would lead to "playing".

Here's a gif showing all of the changes I made today!


We are really close to release! I hope to have this project done before school starts for me on the 30th.


Mateo suggested that I make the snails "crawl" towards the player instead of "jumping". This is a fantastic idea, so I implemented it.

Here's what it looks like: (this is very slow, but the speed is easily adjustable)



I've decided that the snails at the top are going to do a little attack animation (I'll shift them up quickly, then shift them back down, to make it look like they are biting or whatever), then I'll make them fly out to the left.

The new snails coming in from the bottom will quickly fly in from the bottom in their own animation. I can't gradually make them slide in without lots of changes to my code, because I calculate the new snail row after the shifting is done.

I redid my timer code. Before I had one timer, but now I have two timers. The first one is the time between the shifting up of the snails. When it completes, I decrement the second timer, which is the time between new snail rows and eventually the animations.

I might try to stagger the movement of the snails within each row so it looks more realistic, but that's a lot of work.

Thank you so much Mateo, this suggestion made this game look a lot better! :)
14
PC, Mac & Vintage Computers / Re: SnailFont
August 11, 2018, 06:46:15 PM
Quote from: rowan_futurerave on August 11, 2018, 11:52:53 AM
hI iPHOENIX  im back lol
this font is great

I can especially see the digits and the symbols coming in useful (on their own combined with other fonts)
as a whole package - great!

nice work, hope you are good :D

Long time no see! Nice to see you back.
I'm good, myself  ;D

Quote from: 123outerme on August 11, 2018, 03:56:24 PM
I like the look! It reminds me a little bit of the font they used in EarthBound for the Mr. Saturns. Definitely gonna see if I can find a use for it!

Thanks! I see what you mean (the pixelated, loopy, asymmetric and very non-geometric look), but hopefully mine is more readable :)
15

Today I got the menu to the point where I think I can show it off.


Here's the first screenshot of the menu:



It's very bland right now, but I'm adding icons and stuff soon!


The options don't work yet (both lead to the game), but it won't be too hard for me to add this functionality soon.


This was a lot of work, surprisingly. The menu routine itself is quite large, but it'll be able to be used with multiple menus in the game.


I'm running into the problem that I didn't implement all of the characters early on, so I have to add characters as I need them.
I fixed this by writing little JavaScript snippets that takes convpng's output (which it modifies to fit in) and the file with my font data and merges them (it adds the character width, trims padding, and more).
Powered by EzPortal