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

Topics - _iPhoenix_

#1
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:
[spoiler=large quote]
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.
[/spoiler]


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!
#2
PC, Mac & Vintage Computers / SnailFont
July 25, 2018, 04:03:14 PM

SnailFont is a free and open-source perfectly imperfect font suitable for pixel-based games and applications.


It features somewhat whimsical and tilted letters with very few straight lines or circles.


You can download it and try it out here!


These are the characters I have currently: (there are some tweaks that need to be made, the dots on the colon and the period are too big, the exclamation point is too short, the 'g' looks weird, the 'T' is too tilted, the lower zero on the percent sign is crazy weird, etc. I know it's supposed to be imperfect, but I don't want the imperfections to be distracting.)



This font is incomplete, I plan to tweak some of the existing characters slightly, and expand the current character set quite a bit. If anyone feels like helping, I'm writing some style guidelines for new characters.


The name comes from my other project, Attack of the Snails, which this font was made for :)


Enjoy!
#3
x-post from Cemetech, horizontal lines indicate different posts


Earlier this year, I created a small TI-BASIC game that I creatively titled "Dodge". It's not a good enough game for me to release it into the archives, but it's relatively simple and fun. There are 6 rows of "dots" on the screen, and you can switch around rows. You get points for how many dots are on your row, but you lose if a dot makes it to the end of the row that you are on. (You have to switch rows to dodge the dots) There's also a score multiplier/difficulty feature. Occasionally, some dots will not be shown (this is a bug, err, feature), so you have to look at the number in the top to see how many dots are on your row.


Here's a demonstration of that game: (Reminder, this is not a "released" program, it's buggy and stuff. It's also not the one being worked on in this thread.)



Now that I am learning Assembly, I think it would be fun to try and port this TI-BASIC game over. So that's what I'm doing.


I've shifted from a circular layout to a flatter layout, because it makes my math so much easier. I've also chosen to do 8 lines instead of six. I couldn't afford to do this in the TI-BASIC version because of speed, but here switching to 8 will actually make it faster because of how I plan to implement movement (I think it's really clever, I'm going to use circular bit shifts and then an [mono]and[/mono] instruction to check for collisions).


Here's the first actual screenshot:



This is a demonstration of how the game is going to look. The lines on the screen are debug features, I'll change them so they look better eventually.


The green dots are placeholders, too. I'm going to change them into piranha sprites later.
All of the rows on shown there are not random, they are just patterns I made to show off the drawing capabilities (I have checks to make sure that a row of 8 piranhas will never happen in-game). Each "piranha" is represented by one bit in memory (each row is a byte), so changing them is super easy.


I took that screenshot a few days go, when I started the project, I made all kinds of fun additions recently! Now, the screen will scroll with new rows being pseudorandomly (but deterministically, I want all games to be the same) generated on the fly.


Here's a new, updated screenshot:



I'm triggering the changes manually, but eventually it'll go on a clock, speeding up as you play more. This is opposed to the TI-BASIC game, because it generates more squares and goes slightly faster as you play, but this is a little tricky to do and I can make it just as difficult by speeding up more. All of the ones after the initial screen are generated pseudorandomly by a custom routine.


In the screenshot, the battery indicator is drawn and I happened to switch to the next row almost immediately after it did it. Apparently this is caused by the fact that I was using an OS routine (_GetKey) to add manual pauses between the redraws, so it won't be in the final program.


I don't think I'm going to release my source just yet, I want to get more of the core mechanics done first.




Since I wrote the above stuff, a lot has happened! I added player movement and the rows are now on a timer! I haven't done sprites for the player or the piranhas yet, but that is the next big step.






The program is about 450 bytes right now, but I think I can get this down quite a bit. It doesn't seem like a lot (to me, at least), but we don't have all of the features done yet. The sprites are probably going to be at least half of the whole program.




Huge update! I finished the player sprite and added him in to the game.

Here's the sprite I made for the player. His name is Robert, and he's adorable. :P

This is before I put him through convpng, we lose some detail in the hair afterwards, but I'm not going to go to 16bpp just because 8 pixels in the hair are weird.

I'm not entirely content with it and I'll probably change him a little eventually.

Here he is in situ:

He's super tiny (this is a 2x scaled image so that you can actually see him without hurting your eyes). But it's fine, I'll probably scale him up programmatically so the piranhas aren't half his size.

I'm working on a three-frame running animation just for looks, too.
Conveniently (and intentionally) all three frames share the same upper part (only the legs/feet change) and are entirely reversible, so I can save almost 2.5kb (compared to having 3 full-body sprites for each direction) by writing a fun sprite routine.

TheLastMillennial expressed interest in IRC/SAX and in the cemetech thread to do the piranha sprite, so I'm letting him do that.
#4
Web / eZ80-prettify
July 11, 2018, 12:20:32 AM

Today, I wrote a small tool to make your eZ80 programs prettier entirely in the broswer!
It...

  • adjusts your indentation so it stays with the stack, assuming you are using push/pop. (I'm not sure if I can check other methods, like directly manipulating the stack pointer, without a bunch of extra code)
  • formats your comments to increase readability.
  • is entirely customizable, so if you don't like something you can fork the project and change it.
  • probably won't mess with the functional aspects of your code. (if it does, file a bug report/post in the thread)
  • tells you approximately how many changes were made (I like stats)
  • probably will have more things going for it in the future
I wrote it as a tool so I could make my code nicer-looking without too much effort. I'm not at the point where I'm writing "smart-person" assembly yet, but I figure I'll get there soon enough. If you put any code in and it comes out functionally different/breaks, please create a bug, giving me the relevant code before/after prettification. I understand that different compilers have different directives/formatting requirements and stuff, so I might have to provide different options for different compilers. I also understand that this is probably useless with good programming practices.


The default settings used are simply my personal preferences (i.e. use 2 spaces instead of a tab, 2 more spaces before a comment, etc), but (as I said above) this is all changeable, you can find documentation on the individual options here. It was designed and written for myself, but if there's something you don't like, you can change it. If there's something that I'm missing that you think should be added as a default option, please tell me about it!


Check it out here!


To-Do:

  • Allow comments in the inputted code to disable formatting for sections/lines/blocks of code.
  • More customization features.
  • Even more customization features.
  • Document the features I added.
  • Improve the website (allow customizing features in the browser, so you don't have to fork or open the JS console)
#5

Alright, so I've taken up learning Assembly, now that I am more comfortable with middle-to-lower level languages like C and C++, and I've progressed to the stage that I can start to write crappy programs now.


Here's my first actual assembly program. It's pretty bad. You can move a pixel around with the arrow keys. Mateo and PT_ helped me a bit with this one (Mateo helped me realize that the stack exists, and PT_ helped inspire the drawing code).


.nolist
#include "ti84pce.inc"
.list


  .org UserMem-2
  .db tExtTok, tAsm84CeCmp
 
  call _boot_ClearVRAM
  call _RunIndicOff
  ld de, $0050; de holds x coord
  ld c, $50; y coord stored in c
mainLoop:
  ld a, 1 ; draw
  call draw
  call keyWait
  push af ; dammit I love this trick.
    ld a, 0 ; erase
    call draw
  pop af
  call move
  ld a, b; if b is zero, we stop.
  or a, a
  jr z, quit ; relative jump is shorter, byte-wise
  jr mainLoop
quit:
  call _RunIndicOn
  ret
 
draw: ; draws our singular pixel (I set high goals)
      ; (whew this is a bit of work, it gave me lots of appreciation for the sprite routines others have made :P)
      ; we are using 16bpp mode here, so my routines
      ; (which are gently modified 8bpp routines) can
      ; probably be optimized
      ; takes input in a: 1 = draw the pixel, 0 = erase
  push bc ; save c onto the stack (as part of bc)
    ld b, 160d
    mlt bc ; this messes with c
    push bc ; thanks, Mateo
    pop hl
    add hl, hl ; hl * 2
    add hl, hl ; hl * 4 (2 bytes/pixel)
    add hl, de
    add hl, de ; hl += de * 2
    ld bc, vRam ; this also messes with c
    add hl, bc
    ld (hl), $ff ; byte 1
    inc hl
    or a, a
    jr z, _erase
_draw: ; label not needed, included for legibility.
    ld (hl), $00 ; byte 2
    jr _end
_erase:
    ld (hl), $ff ; byte 2
_end:
  pop bc ; restore bc (particularly c)
  ret
 
keyWait: ; waits for a key, keycode returned in a
  call _GetCSC ; get key codes
  or a, a; check scan codes by comparing a with itself (I got this "hack" from various routines, it is super clever)
  ret nz ; if a is not zero, return
  jr keyWait ; otherwise jump (relative jump saves bytes, according to my highly scientific testing)


move: ; input in a (getCSC code)
      ; moves the pixel by updating
      ; de (x coord) and c (y coord)
      ; nothing overly arcane happens
      ; I used to check if a was >= 5 or equal to skDel
      ; but my code caused bugs so I killed it (and the bugs)
   ld b, 1 ; we will set b to 0 if we want to quit
chk_Quit: ; label not used, but it increases legibility and does not harm anything (imho)
  cp skDel
  jp nz, chk_Down
  ld b, 0 ; we want to quit
  ret
chk_Down:
  cp skDown
  jp nz, chk_Left
  inc c
  ret
chk_Left:
  cp skLeft
  jp nz, chk_Right
  dec de
  ret
chk_Right:
  cp skRight
  jp nz, chk_Up
  inc de
  ret
chk_Up:
  cp skUp
  ret nz
  dec c
  ret



As you can probably tell, it's as optimized as I can get it, which is to say not very optimized. I realize these things come with time. [size=0]When will the Dunning-Kruger effect kick in? I like feeling competent...[/size] I'm trying to keep my code optimized and readable so I can look back on it later.


My current assembly setup is SC3 and the Project Builder. This is a temporary setup, and I'm switching to better tools soon. :)


Tips are always welcome.
#6
Phones & Tablets / Block Ninja
June 18, 2018, 06:33:20 PM
Block Ninja is a less-than-fully featured Fruit Ninja clone written for iPhone/iPad using the app Pythonista 3. (The app costs 10USD, but I assure you it is worth every penny of that. It is easily the best Python app in the app store with loads of features you will use and loads of features you didn't know you'd use. I'd actually rather program in it than in the default python Mac install).
It has a lot of awesome features and because of built-in sprites and a decent amount of math it looks quite good!


Eye candy:


Download the latest version of BlockNinja.py from this here and Pythonista 3 from the App Store (if you don't already have it). Load the BlockNinja.py file into Pythonista, and you're all set to play!


It features a high scores table, streaks, bombs, crits, a timer, advanced particle effects, and lots of obscure hacks and shims in the code because it wouldn't be a game written by me without them.


I feel obligated to put this in here, because I am promoting something that does cost real money. I'm not affiliated with Pythonista or its creators in any way (I'm not getting paid or anything for promoting the app), I got the app myself, toyed around with it and think the app is awesome, so you should totally get it, too.

New in v1.1:
- The timer flashes red when you are running out of time
- Loads of helpful and funny (if I do say so myself), in-code documentation.
- Optimizations
- Blocks hit with crits have particles that travel farther.
#7
Tech, Science, IT discussion & News / OEIS golfing!
June 16, 2018, 07:00:48 PM
Inspired by this, and highly inspired by the Programming Puzzles and Code Golf (PPCG) stack exchange. If there are any doubts with the rules, default to their rules.


You must take a sequence in the OEIS (it must be known that it has infinite terms), and write a program taking a input, n, (somehow. If your language doesn't support taking input, editing the source code to insert a decimal number is allowed) and outputting, in base 10 plain text the first n terms of that sequence. You must start at the first term in the sequence. This can be via a file, a function return, etc


No hard-coding solutions, you should use an algorithm.
No reading from external sources.
No asking for the sequence from the user.
The program should be your own work. No stealing programs from other users.
(Use good judgement)
Programming languages are defined by their implementation, so the programming language must have a working compiler/interpreter by the time of this post.
Feel free to help others with their code golf. Be sure to explain what you changed and why it works!

If you are showing off your code golf, format your post like this:
[spoiler]
language name, sequence number, bytes
code
(how to use, if applicable)


optional explanation
[/spoiler]


I'll go first.


JavaScript, A025480, 70 bytes
f=r=>{for(s=[],i=0;i<r;i++)s[2*i]=i,s[2*i+1]=s[i];return s.length=r,s}
Defines a function, f, that returns an array of integers. Call it from the console with f(n), with n being your input.


inb4
JavaScript, A000012, 21 bytes
f=r=>Array(r).fill(1)
Defines a function, f, that returns an array of integers. Call it from the console with f(n), with n being your input.
#8
Web / Markdown to HTML and BBCode!
June 04, 2018, 05:59:15 AM
note, the converter currently is not 100% compatible with CW's BBCode, but compatibility will come eventually! For demonstration purposes, I made no modifications to the output of my program, even though it doesn't work entirely.



A few weeks ago, I had the not-so-crazy idea to write a Markdown renderer in JavaScript. This isn't that hard, Markdown is designed to be easily converted into HTML.


Last night, I realized that BBCode is also designed to be turned into HTML and formatting in Markdown is much more concise than BBCode. Maybe I can write posts faster in Markdown!


This is the result of about a hour of work. The converter uses Regular Expressions to match the Markdown formatting in the input text and replace it with the appropriate BBCode and HTML tags. Here's what I have so far:


[size=20]Headings[/size]
[size=16]Subheadings[/size]
(The Markdown to HTML lets you how down to h4, but I'm too lazy to add this to the BBCode version) 
[strike]strikethrough[/strike] 
bold 
italics 
Inline [mono]code[/mono] 
Code
blocks


  • lists
  • more list (it joins adjacent list elements appropriately) 

Links 
Horizontal bars:


Images: 



This post was converted from Markdown into BBCode using the Markdown -> BBCode converter! You can see the source code for this post here


You can find the converter at https://legend-of-iphoenix.github.io/markdown-bbcode-html/.




To-do

  • Block quotes
  • Somehow, colors???
  • Code cleanup
  • Bugfixing, particularly bugs with italics using asterisks.
  • Escaping? Somehow?
  • Nested lists? Somehow?
  • Ordered lists.
  • Make generated HTML a bit nicer-looking. (Apply formatting rules)
  • Clean up the actual website (I think jcgter777 is going to help with this)
  • Add support for more advanced Markdown.
  • Potentially convert BBCode to Markdown?
#9
Web / PolyJS
May 19, 2018, 05:55:57 AM
PolyJS

PolyJS is a lightweight, fast, and easy to use JavaScript library for manipulating 2D polygons on the HTML5 Canvas.

It lets you create, modify and draw polygons. It also lets you attach points to other points (with or without an offset) so that you can potentially change everything on the screen just by adjusting one value.

I really want to see what kinds of games and art people can make using PolyJS. It lets you do this unique, simple, and interesting art style.


You can download the docs from here, and the latest build from here! Happy Polygoning!


(If you are interested in contributing or just want to poke around, my GitHub repo is here)
#10
What do you use to create pixel art?


I myself use piskel, it's the best free online one I could find.


I'm curious to see what the rest of you use, because it is somewhat lacking in features (even though I'll never need anything else, it's fun to have them at your disposal).
#11
Web / _iPhoenix_ experiments with JS golfing
April 17, 2018, 04:09:54 AM
Now that I have gained semi-competence in JavaScript, I've started trying to get my code down to a certain size, occasionally as small as I can get it. (A.K.A. "code-golfing")


I was inspired to do this primarily by this, which is simply beautiful (in my opinion, of course), and some of the below projects reflect that.


This is a growing list, ordered by creation date, and I'll probably end up editing this post with new scripts as I make them.
1) ASCII art π character, in 360 bytes of code:
document.body.innerHTML=atob("/AAAAAPwAAAAA+AAAAAD4eD/h//H4P8H/9/g/wf/3+D/D///4f8P///h/w///+H/D///wf4P///B/g///8P+D///w/4P//+D/g///wP+D///B/4P8/4D/gfz/Af/AAP4D/8AB/gP/4AP+B//wB8=").split('').map(x=>x.charCodeAt(0).toString(2).padStart(8).split('').map(x=>"# ".charAt(x)).join('')).join('').match(/.{40}/g).map(x=>'<pre style="margin: 0">'+x+'</pre>').join('');
You can find an explanation for this one here. It's really simple, and I created it just as an experiment to see what I could do.
2) Rotating 3D Cube in 500 bytes of JS:
(a=>{var r=-1,e=[r,r,r,r,1,1,1,1],m=[r,r,1,1,r,r,1,1],n=[r,1,r,1,r,1,r,1],t=Math.sin,o=Math.cos,p=Math.PI/36,i=a=>16+(a<0?Math.floor(8*a):Math.ceil(8*a)),l=e.map((a,r)=>.5*a+m[r]*t(24*p));m=m.map((a,r)=>e[r]*t(24*p)-.5*a),e=l,setInterval(a=>{var r=Array.from(Array(32),a=>new Array(32).fill("  "));l=n.map((a,r)=>a*o(p)-e[r]*t(p)),e=e.map((a,r)=>a*o(p)+n[r]*t(p)),n=l,e.map((a,e)=>r[i(m[e])][i(a)]="#"),document.body.innerHTML=r.map(a=>'<pre style="margin:0;">'+a.join("")+"</pre>").join("")},50)})()
I haven't taken the time to produce an explanation for this one, but all it is doing are some point rotations, which (let's be honest) aren't really that interesting. If you just look through the code, you can probably guess what it is doing, and you'll most likely be right, if you know your trig. I'm not really satisfied with it, because I can easily shave off 20+ bytes by storing Array and Math to variables. I also don't need all of the fancy calculations determining when to use Math.floor or Math.ceil. It doesn't provide a noticeable difference to the output and it's just hoarding bytes. Using this suddenly available bytage, I should force the text height:width ratio something I can easily deal with, instead of assuming it is 2.
3) Rainbow Flashy Text in almost 256 bytes of JS
eval(s=`var q=0,a=x=>{q++;document.body.innerHTML=
s.split('\\n').map((x,j)=>x.split('').map((x,i,a)=>
'<kbd style="color: hsl('+(360*(i+q+j))/50+',100'+
'%,50%)">'+x+'</kbd>').join('')).join('<br />')}//
setInterval(a,9);s='eval(s=\`'+s+'\`)'//_iPhoenix_`)

This is by far my favorite one (so far). It uses several of the tricks found in the aemkei world thing, linked above. It displays (almost, I can't do character escaping without some serious additions) the source code of the program and does a fun rainbow pattern. I can't really describe what it does in words, just check it out :P. As with the 3D Cube, this script could also be optimized. But in order for my rainbow effect to look good, all of the rows should be the same length, and any more optimizations would mess with it.




If you have any suggestions for (relevant) things you want me to try (be reasonable), you can post them below, and I might try to do it! (Yes, I am doing that :walrii: as requested)
#12
This is mostly just a thing for SM84CE.  :love:

Notice how I shamelessly advertise my programs a lot? If you haven't, you might be illiterate. Then again, you are reading this sentence.

For example, check out AoJ:
QuoteIn this game, you must fly around the screen capturing grey squares, all while under a time crunch! The movement is simple and intuitive to use, yet refreshingly different and difficult to truly master. Multiple control schemes (arrow keys and number pad) are readily available in-game, to accommodate your preferred method of playing. Featuring multiple modes of difficulty and highscore tables for each, hours of fun are to be had! Screenshots Coming soon! Update: Speed improvements and renamed difficulties.
It is excessively positive, it makes an otherwise dull game sound amazing!

It clearly worked, I have over 2000 downloads on that file, and counting!

In BBS, I go even further:
QuoteIn this strangely fun and satisfying program, you can bounce a bouncy ball in a small room! More details in the readme! Huge thanks to JWinslow23 for taking the time to slice off a ton of bytes from this program.

This program was uploaded at the height of when videos claiming to be the "most satisfying video on the internet" were at their height. The word choice here is crucial.

In Procrastinate, I go all out. I engineered it to be like most of the really crappy App Store descriptions:

QuoteA super fun game, with awesome TI-BASIC graphics, including a rendition of Google Docs and Sublime Text! Can you finish your essay while being distracted by the shiny Sublime Text editor and upgrades screen? Uses no picture variables, only a single program. Includes a highscores table. GIF captured by jcgter777.

I challenge the user to finish my game, making them feel like they are chickening out if they don't download it. I list a bunch of impressive stats (this is a TI-BASIC game, after all) like a machine gun. Overwhelm the user with positivity, and maybe they will click the shiny link called "download"!
#13
Web / iChat
April 01, 2018, 12:29:10 AM
Hello, everyone!


Introducing iChat: the chatting service that isn't my problem.


iChat is a lightweight chatting service. It is not a standalone application. It is supposed to be designed and customized by the user, and does not come with any styling or "creature comforts".


I should probably write some documentation. (Edit: I did!)


To install iChat into your webpage:
1) Install Firebase.
2) Set up user authentication.
3) Set the users' displayNames to the username that will be shown on screen.
4a) Add this line of code into the body tag, where you want it to go.
4b) Add these rules to your database rules.
5) Optionally (but recommended), add styling.

iChat is being used on multiple sites already, but I want to create my own demo for it.

For those interested in seeing the inner workings or wish to assist in the development of iChat, the main JavaScript file is here

Edit: I just updated iChat to v0.3.0

This basically includes a bunch of bug fixes I had done earlier but forgot to push.
#14
Web / Adventures of Jetman JavaScript port!
March 24, 2018, 06:57:31 PM
I've been working on porting Adventures of Jetman to JavaScript for a short while now, and I'm happy to announce that I'm almost done.


You can check out what I have currently at https://legend-of-iphoenix.github.io/AdventuresOfJetman/


It currently is not mobile-compatible, yet, but I plan on adding it.


I just need to make a few sprites and add some critical gameplay features. I've been putting off the former, so I'll casually post the list of sprites I am working on here:
[spoiler]Dude wearing a jetpack, with the jetpack boosting. (facing at the camera, to the left, and to the right. 2+ frame flame animation.)
Dude wearing a jetpack, walking. (to the left, and to the right. 2+ frame walking animation.)
Dude wearing a jetpack, standing still. (facing the camera)
Powerups (red, green, gold)
Site favicon. (done, not implemented)
Currently, I plan on using our :walrii: as a placeholder.
I will be using as a placeholder for the jetpack dude. [/spoiler]
#15
Some of you may remember my old TI-BASIC raycaster. It was made back when I wasn't that good at the language, and I think I broke it with some long-forgotten edit. I was reminded of this by a recent post on Cemetech by someone who was trying to understand my old code to try and make it work.

They weren't very successful. It was a crappy, unreadable script that completely ignored the points that make a good TI-BASIC program. In short, it was a prototype.

A few months ago, I happened to come back to this concept and completely rewrote my code for it. Here's my complete new code (import this with SC3):
StoreGDB 0
ZStandard
ZSquare
GridOff
AxesOff
LabelOff
BorderColor 4
BackgroundOff
{Black,DarkGray,Gray,MedGray,LtGray->L1
For(A,1,10
   For(B,1,10
      If [A](A,B
      Then
         For(C,1,5
            For(D,1,5
               Pxl-On(115+5A-C,5B-D,Black
            End
         End
      End
   End
End
122->A
5->B
DelVar DRepeat K=45
   For(theta,~3,3,.1
      Line(12+theta,3,12+theta,10,0
   End
   Circle(12,6,1.8,Black
   Line(10,6,14,6,1,Black,1
   Line(12,4,12,8,1,Black,1
   For(theta,~40+D,40+D
      If not(remainder(abs(theta-D),10
      Line(12+2.5cos(theta-2D),6+2.5sin(theta-2D),12+2cos(theta-2D),6+2sin(theta-2D),1,Red+(theta=D),1
      sin(theta->U
      cos(theta->V
      DelVar NRepeat Ans or N=10
         N+1->N
         int(A+NU->I
         int(B+NV->J
         pxl-Test(I,Ans
      End
      (theta-D)/5
      Line(Ans,5,Ans,~5,0
      If N!=10
      Line(Ans,(10-N)/2,Ans,~(10-N)/2,1,L1(1+min(int(N/2),dim(L1
   End
   If not(pxl-Test(A,B
   Pxl-On(A,B,Red
   getKey
   Repeat Ans
      getKey
   End
   Ans->K
   Pxl-Off(A,B
   D-5(K=11->D
   D+5(K=15->D
   D-2(K=12->D
   D+2(K=14->D
   int(A+(K=13)2sin(D)+(K=23)5sin(D->A
   int(B+(K=13)2cos(D)+(K=23)5cos(D->B
End
RecallGDB 0


In concept, this is essentially the same program, but I like it much better because it is more concise and readable. It also works. That's somewhat important.

To turn, you use the top 5 buttons on the keypad, namely [y=], [window], [zoom], [trace], and [graph]. To move forward, press [zoom]. To move forward faster, press [del].

This code is not the most optimized I could make it, for the sake of making a understandable tutorial. This tutorial/explanation assumes you understand at least a little trig and TI-BASIC.

Let's break this program down into manageable chunks, which I will explain one-by-one.

StoreGDB 0
ZStandard
ZSquare
GridOff
AxesOff
LabelOff
BorderColor 4
BackgroundOff
{Black,DarkGray,Gray,MedGray,LtGray->L1


This section is pretty much my standard "initialize the graphscreen" set of commands. I store the user's settings to GDB0 to retrieve them when the program is over.

The line storing colors of increasing brightness to L1 is important. It will be explained thoroughly later in this post.

For(A,1,10
   For(B,1,10
      If [A](A,B
      Then
         For(C,1,5
            For(D,1,5
               Pxl-On(115+5A-C,5B-D,Black
            End
         End
      End
   End
End


This code loops through matrix A, drawing a 5x5 "pixel" on the minimap in the bottom left corner of the screen if the value is truthy (i.e. not 0). We use this minimap to do the raycasting.

122->A
5->B
DelVar D


The variables A and B store the row and column (because we are using pixels, they are not the X and Y coordinates) of the player. The D variable stores our rotation. Because DelVar effectively sets it to 0 and 0° is directly left, the player starts out facing left.

Repeat K=45
   For(theta,~3,3,.1
      Line(12+theta,3,12+theta,10,0
   End


Here, we start the main loop. We clear the area where the compass will be redrawn each frame.

   Circle(12,6,1.8,Black
   Line(10,6,14,6,1,Black,1
   Line(12,4,12,8,1,Black,1


This draws a nice little compass in the top right corner of the screen, so that the player knows which direction he or she is facing.

   For(theta,~40+D,40+D
      If not(remainder(abs(theta-D),10
      Line(12+2.5cos(theta-2D),6+2.5sin(theta-2D),12+2cos(theta-2D),6+2sin(theta-2D),1,Red+(theta=D),1
      sin(theta->U
      cos(theta->V


Here is the start of the meat of the program.

We sweep through an 80° arc, centered around the player's rotation value.

The [mono]If not(remainder(abs(theta-D),10[/mono] part and the line following it draw markers on the compass to show the progress. The If statement makes sure that we only draw lines at 10-degree intervals.

As an extra layer of optimization, we store the sine and cosine values of our angle to U and V, respectively, so that we don't have to recalculate them in the next step.

      DelVar NRepeat Ans or N=10
         N+1->N
         int(A+NU->I
         int(B+NV->J
         pxl-Test(I,Ans
      End


This is where the actual raycasting happens.

I reset the variable N to 0. It stores the length of the ray.
We basically keep increasing the radius of an imaginary circle (centered on our player) by 1, calculating the point on this circle at our angle, θ, and checking if there is a pixel drawn there. To save time, if the circle has a radius equal to 10 and we still haven't hit anything, we stop calculating the ray. The value of 10 is essentially our "maximum render distance".

A raycaster basically casts a ray from the player's position at each angle in the player's FOV, measuring the distance the ray travels until it hits a wall.

      (theta-D)/5
      Line(Ans,5,Ans,~5,0
      If N!=10
      Line(Ans,(10-N)/2,Ans,~(10-N)/2,1,L1(1+min(int(N/2),dim(L1
   End


This is most of our drawing code, and also the ending of our drawing loop, where we were iterating through each of the angles.

We clear out anything on our "canvas" where the line is going to go. If we didn't prevent the ray from continuing to propagate, we draw a line on our graph. The X coordinate is reliant on the angle, while the vertical length of the line and the color of the line is solely influenced by the length of the ray. If the ray took longer to hit a wall, the line should be shorter and lighter in color, because it is further away.

   If not(pxl-Test(A,B
   Pxl-On(A,B,Red


You might have noticed that we never actually drew the player in on the minimap yet. This is because some rays would hit the player and register as there being a wall right where the player is, even if there isn't one. If we didn't stop the ray from continuing to propagate, we can safely draw this in now. I first do a check to make sure that we are not inside of a wall. I should probably add player collision checking, but it's a trivial thing in this scenario.

   getKey
   Repeat Ans
      getKey
   End
   Ans->K


This section of code heads our user input.

The first getKey prevents any keys that were pressed during the drawing from being registered in our movement-handling code. I don't fully understand how or why this happens, but it does.

We then wait for the user to press a key, and store the key code they pressed to K.

   Pxl-Off(A,B
   D-5(K=11->D
   D+5(K=15->D
   D-2(K=12->D
   D+2(K=14->D
   int(A+(K=13)2sin(D)+(K=23)5sin(D->A
   int(B+(K=13)2cos(D)+(K=23)5cos(D->B


Next, we turn off the pixel on the minimap representing the player. I have explained why we need to do this earlier in the post. The next section, which I intentionally left unoptimized, adjusts the rotation of the player. If the user presses the [y=] button, we assume they want to rotate more than if they pressed the [window] button. After this section of code, we move the player.

If the player pressed the [zoom] button, we move them forward by (approx.) 2 pixels. Because the rendering process is so slow, though, we also give them the option to move forward by 5 pixels by pressing [del].

End
RecallGDB 0


This last little bit of code closes up our main loop. When the user presses [clear], the loop stops (because of the "K=45" at the beginning), and we recall the user's graph settings back.

If you enjoyed reading this, it helped you, or you need help understanding something, please do not hesitate to reply below. If you do not have an account yet, they are free and only require a few minutes of your time to create.
#16
Web / The Button
March 03, 2018, 08:30:34 PM
Link to site.

The Button is a KotH-style game where the last person to click a button has their username shown on everyone's screen, at least until the next person clicks the button.

It's pretty basic right now and in dire need of styling, but I'm working on that and a leaderboard system.

I showed it off on IRC/SAX and nearly everyone who tried it seemed to enjoy it, so have fun!
#17
This is a cross post of my CC21 (Cemetech Contest 21) thread. (I know a lot of you guys don't look over there that often, so I'm posting it over here  :) )

I'm going to create a "days-off-from-school" Simulator, because days off from school are usually on or around holidays.

I plan on having a Google Docs-esque screen, where you cask write out the essays you inevitably were assigned right before the break started. Your "work" meter goes up, but so does your "boredom" meter.

You can also switch over to a sublime text-esque screen, or a Cemetech SAX-esque screen, where your work meter doesn't move, but your boredom meter goes down and you get "coolness points".

I plan on doing this in pure BASIC, with no picture variables. I like pushing limits, as you probably know.

I also plan on including the adorable :walrii: somehow.

Anywho, here's some eye candy!

The stuff on the left are the two bars, work and boredom, respectively:


I thought I'd post this too:


As you can tell, I need to make some changes. It's not 100% faithful, partially because I did this entirely from memory.

The blank Sublime Text screen, also done from memory:

Typing of the essay:


You can view the sublime text editor by switching tabs with the right arrow. If you are in the sublime text editor, you can switch tabs left again with the left arrow.

I'm not releasing the code for the code-typing just yet. I'm not fully done optimizing it :)


You can download the file, screenshots, and source and suggest changes (this particular contest allows collaboration) on my GitHub repo!

I also recommend checking out my Cemetech thread. There are some minor details that I didn't include here in the interest of a short-ish post.

:walrii:
#18
Contests / UCC4 [ucc4]
February 14, 2018, 01:04:03 AM
This contest's topic is: :3= ! To be eligible for a prize, you must make a program that creates walruses of all hues!
To be eligible, you must make a topic showing your progress, with the "[UCC4]" tag in the title.

The contest will end whenever there are enough competitors. No late entries will be accepted.

Users should be able to enter two hex values in #RRGGBB format: one for the body, and one for the eyes. On-Calculator entries in ICE/C/Assembly will be allowed to use the xlib color palette, and TI-Basic entries... well... GLHF...

Only the gray parts of the :3= should be tinted with the color for the body, and only the coloring of the eyes should be tinted for the eye color.

All pixels should be tinted relatively:
For example, the dark grays on the :3= should become darker reds than the light grays if I enter #FF0000 as the body color. Notice how the golden walrus in my signature and in the below spoiler has dark golden tones where the normal walrus has dark grays.

[spoiler=gold walrus][/spoiler]

You cannot release source publicly until after the contest, to avoid plagiarism.

*keep your entry SFW, please*

Note: due to the laws of the universe, it is not possible/is extremely difficult to contribute an entry if you happen to die at the hands flippers of an axe-murderer walrus during this contest. Be careful.

You will be judged on these criteria, although your entry can be penalized at the discretion of the judges, to some extent:
- overall project detail and completeness, including functionality and design
- code readability
- interaction with other users, including the reception and distribution of feedback.
- overall ingenuity.
- number of walruses involved (we aren't kidding this time)

We are placing an emphasis on readability, so that future users can potentially learn something from your code.

Contest judges (i.e. me, but you can request to be one if you have over 100 posts, just ask in this thread. Only 2 more judges will be accepted.) are not allowed to participate, and cannot win prizes.

As for prizes, printable walrus "diplomas" will be issued to the top three winners, signed by the contest judges under their usernames. (If you are accepted as a judge, PM me a pic of your signature, signing as your username)
[spoiler=legal crud]Neither myself; the contest judges; the CodeWalrus site, admins and users; or contest participants are liable for any damage or legal c you come up with.
The opinions expressed by the judges in the choosing of a winner may not represent the entire views of the CodeWalrus community or admins.
All decisions are final, unless they aren't.[/spoiler]
Have fun! If you have any questions about this do not be afraid to ask in this thread!
Previous winners:

[spoiler][ucc1: weather]
1: Juju + kotu
2: -
3: -
[ucc2: 8-bit animation]
1: Jarren Long
2: Juju
3: -
[ucc3: ascii game thingie]
1: Juju
2: -
3: -
[/spoiler]
#19
Web / Mys
February 11, 2018, 07:11:30 PM
Mys is a programming language.


But it is also a challenge.


No documentation is provided. You have to make a "Hello, world!" program, producing that exact text (it's possible in under 200 characters.). If that is achieved, you can see the challenge progression below.


Trying to deobfuscate or debug the source code is cheating, and sharing large amounts of Mys syntax secrets ruins the fun for all future users. The point of the language is for new users to discover things for themselves. Don't ruin it for others. If you don't like that, then stop using Mys and ignore this thread.



You should submit your source here if you accomplish a challenge. Do not post it, because then people might figure out the syntax. (Hopefully you understand the point of Mys by now. The syntax is supposed to by a mystery)

Challenge progression list available here!
Completed Challenges (spreadsheet)


Have fun. Link to interpreter

If you are stuck, use a hint.

Found a bug? PM me your source and the output :)
#20
Web / N.E.U.P.L.
February 06, 2018, 01:35:13 AM

N.E.U.P.L.: New Experiments in Uninteresting Programming Language(s).


Interpreter Here


Docs Here


NEUPL is a simple stack-based language. Check the docs for more info :ninja:
I'm nearly 100% sure it's not Turing Complete, unless there is some form of bug with the language.


Interesting NEUPL code snippets:
Quote"Hello, world!": !<d<l<r<o<w< ,<o<l<l<e<H<lp
"hi", but it's really overcomplicated (kudos to you if you can understand it): i<<h<<l<<p<i<p<l<pie
"Hello, _iPhoenix_" (demonstrates command insertion and printing newlines with an empty stack and lp): lp,<o<l<l<e<H<l<pip_<pi<x<i<n<e<o<h<P<i<_<l<piplp


There are some notable bugs, particularly with the execution of commands from the stack. I think I know why, but I'll take some time to fix.


Additionally, I want to be able to manipulate the stack in other ways, like flipping it, changing ASCII values of characters in the stack, and more.


The goal of this programming language is ,<r<a<e<l<c<n<U<lp.<w<o<n< <r<o<f<lp (Unclear, for now.)


Just note that more commands are coming, and this is slightly buggy, so don't worry too much if something isn't working.
And yes, I'll continue to work on UniChat. This is just a small excursion from that.
#21
Other / kotu thinks we don't want him back.
January 04, 2018, 10:15:23 PM
Hey, all.


I've been talking with @kotu (via YouTube comments) and it appears he thinks we don't want him back.


He asked me to name one person who wants him back (presumably besides myself). So, we have this thread.


Please post here if you want kotu back. (and why, and reinforce how he can get back)
Edit: Due to the coherency and sensibility coming out of the conversation we had, it seems he is getting much better.
#22

Hey guys!


I made a really sweet bouncy ball simulator program, and you can download it here.





I had a lot of help from JWinslow23, who slimmed down the program nearly 12.5% (Which doesn't seem like much, but it was quite a bit of clever programming.)


You can add velocity to the bouncy ball with the arrow keys, and quit with [del]. Enjoy!
#23
Gaming / Marble Run
November 22, 2017, 12:40:06 AM
This has been a popular thread over on Cemetech recently, so I think I'll bring the love over here:
Create a track here!


Here are some of mine, if you need inspiration:
http://www.marblerun.at/tracks/611681
http://www.marblerun.at/tracks/613123
http://www.marblerun.at/tracks/613345
Mateo then exploited a trick/glitch I found in the above track, and created this monster:
http://www.marblerun.at/tracks/613359

http://www.marblerun.at/tracks/613401
http://www.marblerun.at/tracks/613442
http://www.marblerun.at/tracks/613470 << this is my favorite. Please like it :P
http://www.marblerun.at/tracks/613478
http://www.marblerun.at/tracks/613487
http://www.marblerun.at/tracks/613495
#24
Web / Ascii Breakout [ucc3]
November 18, 2017, 02:58:00 PM
DISCLAIMER:
Although I cannot and will not enter this into the contest, I will still be making a UCC3-style entry. This time around, the contest seems really fun. If you want to create Breakout for your entry, feel free to do so. It will probably be better than mine.
  :thumbsup:

I will be creating an Atari Breakout clone, in grayscale, using the full char palette, uhh, I provided.

I will try to make it multiplayer in a time based fashion, where Player 1 does a playthrough, and Player 2 has to beat his/her time. (I might be able to get them to play simultaneously, it depends.)

[No screenshots yet]
#25
Contests / UCC3 [ucc3]
November 18, 2017, 01:35:35 AM
This contest's topic is: ASCII Games! To be eligible for a prize, you must make a VANILLA JAVASCRIPT game,  that exclusively uses monospaced ASCII art. To be eligible, you must make a topic showing your progress, with the "[UCC3]" tag in the title
The contest will end on January 1st, 2018 at 11:59:59 EDT (hopefully on-time). No late entries will be accepted.


You cannot release source publicly until after the contest, to avoid plagiarism.


*keep your entry SFW, please*


Note: due to the laws of the universe, it is not possible/is extremely difficult to contribute an entry if you turn into a black hole during this contest. Sorry.


You will be judged on these criteria, although your entry can be penalized at the discretion of the judges, to some extent:
- overall project detail and completeness, including functionality and design.
- interaction with other users, including the reception and distribution of feedback.
- overall ingenuity.
- number of walruses involved (just kidding, this will not affect your score)
Contest judges (i.e. me, but you can request to be one if you have over 100 posts, just ask in this thread. Only 2 more judges will be accepted.) are not allowed to participate, and cannot win prizes.


As for prizes, printable walrus "diplomas" will be issued to the top three winners, signed by the contest judges under their usernames. (If you are accepted as a judge, PM me a pic of your signature, signing as your username)


[spoiler=legal crud]Neither myself; the contest judges; the CodeWalrus site, admins and users; or contest participants are liable for any damage or legal c you come up with
The opinions expressed by the judges in the choosing of a winner may not represent the entire views of the CodeWalrus community or admins.
All decisions are final[/spoiler]


Have fun!


If you have any questions about this do not be afraid to ask in this thread!


Previous winners:
[spoiler][ucc1: weather]
1: Juju + kotu
2: -
3: -
[ucc2: 8-bit animation]
1: Jarren Long
2: Juju
3: -
[/spoiler]


Here are all of the different characters you can use:
[spoiler]A-Z
a-z
0-9
[]{}#%^*+=_/\|~<>.,?!'-:;()$&@"[/spoiler]
You can request more in this thread, if I missed some. I internionally disallowed some characters, though.


I will be testing all entries on a html page:
<!DOCTYPE html>
<html>
<head>
<script src="path/to/file.js"></script>
</head>
<body>
</body>
</html>



As you can see, there's not much there. You will need to use the JS to create all of the elements and styles you need. (Keep it grayscale, though, for bonus points)


Bonus points for multiplayer (same device multiplayer, no backend allowed) see below.


Winning entries might be featured on a website I am making. (successor to UniChat, but with games, karma, a small help forum, etc)

Edit:
Here's one huge thing you need to know: the font!
A monospaced font, Inconsolata will be used.

If you are creating an entry, insert the following code at the top of your main JS file (the one that will be loaded first), or add the code to your existing window.onload event handler thing. Feel free to change the code as you need. Remember that no CSS files are allowed; it all has to be done in JS using <object>.style.<tag> = <style>

//I figure you will want to use the <body> tag later, so I put it up here. You probably don't need the <head> tag for much, so I made it a local variable.


var body;


//when the content is loaded.
window.onload = function() {
   //get the <body> tag from the document.
   body = document.getElementsByTagName("BODY")[0];
   //get the <head> tag from the document.
   var head = document.getElementsByTagName("HEAD")[0];
    //create a <link> tag.
   var fontLink = document.createElement("LINK");
   //adjust the properties of the link tag to looks like this: <link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">
   fontLink.setAttribute("href", "https://fonts.googleapis.com/css?family=Inconsolata");
   fontLink.setAttribute("rel", "stylesheet");
   //add the tag to <head>
   head.appendChild(fontLink);
   //set the style of everything in the <body> tag to use the font from the <link> tag.
   body.style.fontFamily = "'Inconsolata', monospace";
   //the following code is optional CSS formatting to make the screen look cool. You do not need it.
   body.style.backgroundColor = "#000";
   body.style.color = "#ccc";
};



If you are using multiple JS files, you should specify in your thread in what order they should be added (and where they are located), or add to the above code in order to load the others in the order you need.

Edit:
I've changed the rules so that you can do multiplayer IF AND ONLY IF you can get it to work with Google Firebase.  <3
(and yes, I will include the required <script> tags for firebase)
#26
Web / UniChat!
November 12, 2017, 11:37:38 PM
Site is here!
Today, (As I am posting this) I created a free, simple, and open solution to a problem exactly none of us have. I created what is essentially an IRC chatroom, but crappier!


Introducing UniChat, which is a bare-bones, embarrassingly simple chatroom!


Utilizing Google's powerful Firebase platform, it is a place where you can communicate with the other users, which has peaked at 5 (yay, much many users)!


Not only is it a great messaging tool, but I am using it to create a bounty of anonymized, secure data that my machine-learning algorithms can learn human behaviour from!


It is also in active development, with new features arriving every day! (keep in mind that I came up with the idea ~8 hours ago as I am posting this)


Planned features: (starting at -2 because I was too lazy to go back and change the numbers as I came up with new ideas)
-2) OMFG CSS
-1) Username-from-cookie detection (so you don't have to keep typing the same username every time you reload the page)
0) Message submission with pressing the Enter key.
1) highlights and @mentioning
2) URL detection and creation
3) pm's and /me
4) private chatrooms (maybe)
5) ???


Current features:
1) Working message storage.
2) Usernames
3) Automagic pseudorandom default username creator thing
4) Unlimited message length (intentional abuse = limited message length, and/or ban from service. Potentially worse punishments will be added, if I can come up with new punishments :/)
5) Amazing, CSS-less layout.


Please do not use severely profane words (i.e. worse than ccrraapp) on UniChat.


I am also looking for more adjectives and nouns for the automagic pseudorandom default username creator thing (you can type lists of them into the service, I can check the logs if you want)
#27

x-post from Cemetech. Thought I'd post this awesome project of mine here.


<short version>
I made a cool new game that uses a less-common speed-based movement system, combined with a time crunch, to induce hilarity upon players.  It features multiple difficulties (and highscore tables), two different movement schemes, and fast-paced gameplay.


Now go read the long version, even if parts of it don't make sense to you!
<long, somewhat technical version>


I have been working on a new, fast-paced game! The concept isn't anything new: move around, collect tokens/points/coins/targets, in a race against the clock. 
But this version has a major twist: I used an intuitive and easy to learn, yet very difficult to master movement system based off of speed, not just location.  Instead of simply moving the character one 'tile' left, right, up, or down, I add to the speed in that direction. (the speed itself slowly decreases, too, until it becomes zero.  I use that to simulate gravity, even though the gravity in-game is less like Earth, and more like the gravity on a planet with much less mass.)
This is really cool, because it means that a button press affects your movement even after you have released the button.  This punishes trigger-happy people (like myself) and rewards people who think about the entire situation, then press the button(s). [size=0]I'm trying to be objective here, but certain people in the media recently (namely Trump and certain North Korean leaders) need to learn from this game. [/size]
Combined, this leads to a runaway effect, where people stressed out about the time crunch press the button too many times, leading to them missing the target, which makes the time go down further.  (and the cycle repeats, at least until they pause with [clear] and chill/think for a few minutes, slow down, or lose a life and restart the clock.  But those victories are short lived.)
Due to the fact that this isn't really a commonly used movement scheme (and people inherently aren't used to it), I have several difficulties.  Easy isn't really meant to be a challenge, and experienced players can get indefinitely high scores (mine is 512, with three lives.  It gets boring really fast with the lower difficulties and a relatively high skill level), rather, it's a lesson for the people who aren't used to the controls.
I have different highscore tables for each difficulty, because converting subjective difficulties to objective scores isn't really my thing, and it gets messy.  (I also have different control schemes, but that's pretty self-explanatory)
I hate for this to be a side note, but I'm really happy with the speed I managed to get.  Due to the fast-paced nature of the game, I don't wait for user input, but check if there has been user input in the past frame. (it appears the getKey command retrieves keypresses received while other commands have been running.  This may just be my imagination, but it certainly seems so)


Download Adventures of JETMAN!
#28
Contests / Unofficial Codewalrus Contest 2 [ucc2]
September 13, 2017, 10:03:34 PM
This contest's topic is animation/animating, especially of the 8-bit variety. To be eligible for a prize, you must make a program or create an IRL creation that involves animation/animating, and topic showing your progress, with the "[UCC2]" tag in the title
The contest will end on October 14 at 11:59:59 EDT (hopefully on-time). No late entries will be accepted.

If you choose to make an IRL creation, you might want to create a video describing your project and its features.

If you choose to make a program, for any platform/language, you cannot release source until after the contest, to avoid plagiarism.


*keep your entry SFW, please*


Note: due to the laws of the universe, it is not possible to contribute an entry if you are dead. Sorry.

You will be judged on these criteria, although your entry can be penalized at the discretion of the judges, to some extent:
- overall project detail and completeness, including functionality and design.
- interaction with other users, including the reception and distribution of feedback.
- overall ingenuity.
- number of walruses involved (just kidding, this will not affect your score)
Contest judges (i.e. me, but you can request to be one if you have over 100 posts, just ask in this thread. Only 2 more judges will be accepted.) are not allowed to participate, and cannot win prizes.

As for prizes, printable walrus "diplomas" will be issued to the top three winners, signed by the contest judges under their usernames. (If you are accepted as a judge, PM me a pic of your signature, signing as your username)

[spoiler=legal crud]Neither myself; the contest judges; the CodeWalrus site, admins and users; or contest participants are liable for any damage or legal c you come up with
The opinions expressed by the judges in the choosing of a winner may not represent the entire views of the CodeWalrus community or admins.
All decisions are final[/spoiler]

Have fun!

If you have any questions about this do not be afraid to ask in this thread!

Previous winners:
[spoiler][ucc1: weather]
1: Juju + kotu
2: -
3: -[/spoiler]
#29
This may or may not come to complete fruition, but I am working on a cool project.


I have been kinda interested in autonomous robots, expecially object avoidance, so I am creating a program that lets the user define a path, create obstacles, and the code will go through, relying on its vision, similar to the way a human does.


This is basically the combination of Mario Kart, a raycaster, and a robot, implying it is ugly, but it gets the job done.


(I have most of that done)
Eventually, I would like to have multiple bots taking different paths, then pick the most efficient one and show it to the user.


I will not include eye candy yet, but just know this is coming...
#30
Contests / Unofficial Codewalrus Contest #1
July 20, 2017, 06:30:43 PM
(Well, Juju told me I could do this, so I guess it is semi-unofficial)


This contest's topic is weather. To be eligible for a prize, you must make a program or create an IRL creation that involves weather, and topic showing your progress, with the "[UCC1]" tag in the title
The contest will last 4 weeks, and end on the 17th of August 9th of September at 11:59:59 EDT. No late entries will be accepted.


If you choose to make an IRL creation, you must create a video describing your project and its features.


If you choose to make a program, for any platform/language, you cannot release source until after the contest


*keep your entry SFW*


All entries are to be submitted to in a PM to me, @_iPhoenix_



You will be judged on these criteria, although your entry can be penalized at the discretion of the judges, to some extent:
- overall project detail and completeness, including functionality and design.
- interation with other users, including the reception and distribution of feedback.
- overall ingenuity.
- number of walruses involved (just kidding, this will not affect your score)
Contest judges (i.e. me, but you can request to be one if you have over 100 posts, just ask in this thread. Only 2 more judges will be accepted.) are not allowed to participate, and cannot win prizes.


As for prizes, printable walrus "diplomas" will be issued to the top three winners, signed by the contest judges under their usernames. (If you are accepted as a judge, PM me a pic of your signature, signing as your username)


[spoiler=legal crud]Neither myself; the contest judges; the CodeWalrus site, admins and users; or contest participants are liable for any damage or legal c you come up with
The opinions expressed by the judges in the choosing of a winner may not represent the entire views of the CodeWalrus community or admins.
All decisions are final.[/spoiler]


Have fun!


If you have any questions about this do not be afraid to ask in this thread!
#31
Randomness / Boredom Thread!
June 22, 2017, 09:54:43 PM
Summer is here, and unfortunately that means most people have either too much free time, and are bored, or have not enough free time or are on vacation.




Post here about your far-out ideas that just could not happen, interesting things you heard about, or anything that bothers you, in the attack against boredom!


Also feel free to demonstrate your prowess with the WYSIWYG editor, using cringey memes, and the like, but don't be too obnoxious.


Have fun!
#32
I, _iPhoenix_, have created a portal to the dimension where there are strange beings called "doofii" playing with our familiar :walrii:. My camera/potato sucks, so live with it.


The walruses in this dimension are cute, intelligent, mischievous, and very friendly.
The doofii are extremely stupid, but get the job done in the end (their cities are more lopsided than the Tower of Pisa...)


Here's some of my sketches detailing what I have found.
[spoiler]https://ibb.co/fHH3k5
[spoiler]https://ibb.co/f81UQ5
[spoiler]https://ibb.co/njrUQ5
[spoiler]https://ibb.co/mrc3k5
[spoiler]https://ibb.co/nvfdJQ
[/spoiler]
[/spoiler]
[/spoiler]
[/spoiler]
[/spoiler]

And I did the images like that to force you to look at them in the order I drew them.
#33
Randomness / Walrii storytelling!
May 30, 2017, 11:39:33 AM
Basically, just add to the story (keep it small/simple/:walrii:) of the person in front of you.

Things in code tags are not part of the story. They could be suggestions, comments, praise, etc

Here's the story:


Quote from: p2 on May 30, 2017, 10:02:15 AM
Quote from: _iPhoenix_ on May 29, 2017, 04:32:00 PM
But shhh... We are observing the secretive :walrii: in its natural habitat...


*suddenly a naked walrus crosses our way, nipping on a cup of coffee, screaming "Nüf nüüüf" as it sees us*


*suddenly, it charges us, screaming "nüüüüüüüüüf", and our walrii translator tells us that it means either "ooh cute non-walrii" or "mommy?"*


Try not to stress out the :walrii:...
#34
*This is for the CE* (At least, I programmed it for and on the CE)


I've been working on this little sub-project (It's part of a larger thing), but have hit a roadblock. I need to be able to fill in the sides with a single color, and I need it to be somewhat fast. It should also cover up the edges that should be on the back. I'm thinking to use flood fill, but that is not exactly a fast way of doing it. I split the code into several programs for ease-of-development.


Sets the current object being drawn to a cube.
prgmOBJCUBE
Ans->|LTEMP
|LTEMP(1->A
|LTEMP(2->B
|LTEMP(3->C
|LTEMP(4->W
|LTEMP(5->H
|LTEMP(6->D
[[(A),(B),(C)][(A),(B),(C+D)][(A),(B+H),(C)][(A),(B+H),(C+D)][(A+W),(B),(C)][(A+W),(B),(C+D)][(A+W),(B+H),(C)][(A+W),(B+H),(C+D)]]->[A]
[[1,2][2,4][4,3][3,1][5,6][6,8][8,7][7,5][1,5][2,6][3,7][4,8]]->[B]



Sets the current object to a triangular prism
prgmOBJTRIP
Ans->|LTEMP
|LTEMP(1->A
|LTEMP(2->B
|LTEMP(3->C
|LTEMP(4->W
|LTEMP(5->H
|LTEMP(6->D
[[(A),(B),(C)][(A+W),(B),(C)][(A+W),(B),(C+D)][(A),(B),(C+D)][(A+W/2),(B+H),(C+D/2)]]->[A]
[[1,2][2,3][3,4][4,1][1,5][2,5][3,5][4,5]]->[B]



Sets the current object to a tetrahedron
prgmOBJTETR
Ans->|LTEMP
|LTEMP(1->A
|LTEMP(2->B
|LTEMP(3->C
|LTEMP(4->W
|LTEMP(5->H
|LTEMP(6->D
[[(A),(B),(C)][(A+W/2),(B),(C+D)][(A+W),(B),(C)][(A+W/2),(B+H),(C+D/2)]]->[A]
[[1,2][2,3][3,1][1,4][2,4][3,4]]->[B]



Lets you move independently of the object.
prgmMOVE
Ans->A
(A=0)-(A=2)->B
Xmin+B->Xmin
Xmax+B->Xmax
(A=1)-(A=3)->B
Ymin+B->Ymin
Ymax+B->Ymax



Scaling, used for 'movement' on the z axis.
prgmSCALE3D
Ans->theta
dim([A]->L1
For(A,1,L1(1
For(B,1,L1(2
theta*[A](A,B->[A](A,B
End
End



Translates the object, but interferes with rotation.
prgmTRANSL8
Ans->L1
L1(1->Z
dim([A]->L2
L2(1->T
For(A,1,T
[A](A,Z)+L1(2->[A](A,Z
End



Draws the object.
prgmDRAW3D
dim([B]->L1
For(E,1,L1(1
Line([A]([B](E,1),1),[A]([B](E,1),2),[A]([B](E,2),1),[A]([B](E,2),2),1,Black,1
End



Helpful info:
[A] is the list of Vertices, and B (the matrix, screw you, bbcode..) is the list of edges. A '1' in  would correspond to the first row/vertex, a '2' for the second, and so on.

Rotates, in 3 dimensions.
prgmROTATE:
[/b]Ans->L1
Ans(2->theta
sin(theta->A
cos(theta->B
dim([A]->L2
For(N,1,L2(1
[A](N,1->I
[A](N,2->J
[A](N,3->K
If 0=L1(1
Then
JB-KA->[A](N,2
KB+JA->[A](N,3
Else
If 1=L1(1
Then
IB-KA->[A](N,1
KB+IA->[A](N,3
Else
If 2=L1(1
Then
IB-JA->[A](N,1
JB+IA->[A](N,2
End
End
End
End


Renders, and lets you interact:
prgmRENDER3D
Disp "DIM. OF OBJECT:
Input "X: ",A
Input "Y: ",B
Input "Z: ",C


Input "OFFSETX: ",S
Input "OFFSETY: ",T
Input "OFFSETZ: ",U
ClrDraw:BackgroundOff
0->|N
//change object type by appending "CUBE", "TRIP", or "TETR" to the following line.
{S,T,U,A,B,C:prgmOBJ
prgmDRAW3D
Pause
ClrDraw
Repeat 0
Repeat Ans
getKey
End
Ans->F
//too lazy to optimize this, shouldn't really affect speed.
If F=73:Then
{0,pi/16:prgmROTATE:Else
If F=93:Then
{0,~pi/16:prgmROTATE:Else
If F=82:Then
{1,pi/16:prgmROTATE:Else
If F=84:Then
{1,~pi/16:prgmROTATE
End
End
End
End
If sum(F={43,52,54,63
Then
1(F=43)+2(F=52)+0(F=54)+3(F=63):prgmMOVE
End
If sum(F={21,31
Then
.8
If F=21
Ans^^-1
prgmSCALE3D
End
ClrDraw
prgmDRAW3D
End



Renders and slowly rotates the object (I'm really inspired by gLib's screenshots)
prgmROTATE3D
Disp "DIM. OF OBJECT:
Input "X: ",A
Input "Y: ",B
Input "Z: ",C


Input "OFFSETX: ",S
Input "OFFSETY: ",T
Input "OFFSETZ: ",U
ClrDraw:BackgroundOff
//change object type by appending "CUBE", "TRIP", or "TETR" to the following line.
{S,T,U,A,B,C:prgmOBJ
prgmDRAW3D
Pause
For(Z,0,1
{Z,pi/16:prgmROTATE
End
Repeat 0
{1,pi/64:prgmROTATE
ClrDraw
prgmDRAW3D
End



With my luck, I missed a program, but I need help :(


Most of the changes would be in DRAW3D, presumably, as that is where everything (so far) is drawn.


Controls (for RENDER3D):


Use the numberpad to rotate. 8 and 2 rotate on the 'y' axis, 4 and 6 rotate on the 'x' axis.
Use [2nd] to zoom in, [alpha] to zoom out (move closer and further)
Use [prgm] to move up, [sin] to move left, [tan] to move right, and [)] to move down.


I think that's it.
EDIT: No it isn't.
Instructions to run:
Press these exact buttons:
[zoom][6][zoom][5][prgm]
Then you can run the program (either RENDER3D or ROTATE3D). Be sure to change prgmOBJ to the selected shape before running!
#35

Help Johnny (the character) find free wifi so he can watch his funny cat videos!


Navigate the blue (color can be changed in "options") dot into the circles (range of the wifi), using the [4] and [6] keys. The darker the circle (more "bars"/better quality), the more points you get. If a circle is red (locked), then you lose points.


If you reach the end or travel into the shaded sides, your game ends and you are redirected to a highscores table. You can reset the table by going to the main menu (running the program again), going to the options menu, and typing in the number it shows you. I added the last part for several reasons:
1) it's fun to implement.
2) It's like a captcha!
3) Prevents accidental resets. Those are ANNOYING!


I think that's all.


Here's some messy code:
SetUpEditor
SetUpEditor |LWIFIS
1->dim(|LWIFIS
If not(|LWIFIS(1
Blue->|LWIFIS(1
ClrHome
Lbl M0
Menu("WIFI |v1.5","PLAY!",M1,"OPTIONS...",M2
Lbl M2
Menu("OPTIONS...","PLAYER COLOR",PC,"CLEAR HIGHSCORES",CH,"BACK",M0
Lbl PC
Input "PLAYER COLOR: ",P
If P<=DarkGray and P>=Blue
Then
Disp "INVALID COLOR
Else
P->|LWIFIS(1
Pause "PLAYER COLOR SET.
End
Goto M0
Lbl CH
randInt(1,256->G
Disp "CLEAR HIGHSCORES...","--------------------------","TYPE "+toString(G)+" IF YOU ARE SURE."
Input ":",P
If P=G:Then
SetUpEditor |LWIFI
Fill(0,|LWIFI
Archive |LWIFI
End
Goto M0
Lbl M1
ZStandard:ZSquare:AxesOff
0.25->|N
{Red,White,LtGray,Gray,DarkGray,Black->L5
7->dim(L6
Line(Xmin,15,~10,15,1,Black,4
Line(10,20,Xmax,20,1,Black,4
randIntNoRep(~8,8,7->L1
randIntNoRep(~8,8,7->L2
randIntNoRep(1,4,4->L4
augment(L4,{randInt(1,4),~1,~1->L4
L4+2->|LC
1->|LC(6
Ans->|LC(7
For(A,1,7
Pt-On(L1(A),L2(A),3,Black
If 0<L4(A
Then
int((randInt(2,4)*(6-L4(A)))/4)->L3(A
Else
randInt(1,4->L3(A
End
Circle(L1(A),L2(A),L3(A),L5(|LC(A))
End
DelVar PDelVar AYmin->B
Pt-Change(A,B,|LWIFIS(1
Repeat (B>Ymax) or (A>10) or (A<~10)
Repeat Ans
getKey
End
Ans->K
Pt-Change(A,B,|LWIFIS(1
A+2|N*(~(K=82)+(K=84)->A
B+|N->B
Pt-On(A,B,1,|LWIFIS(1
For(N,1,7
(A-L1(N))^^2+(B-L2(N))^^2->D
If D<=(L3(N)^^2+1)
Then
P+L4(N->P
1->L6(N
Else
If L6(N:Then
Circle(L1(N),L2(N),L3(N),L5(|LC(N))
Pt-On(L1(N),L2(N),3,Black
End
0->L6(N
End
Text(1,1,P
End
End


SetUpEditor |LWIFI
10->dim(|LWIFI
augment(|LWIFI,{P->|LWIFI
SortD(|LWIFI
10->dim(|LWIFI
|LWIFI->L1
Archive |LWIFI
ClrDraw
Text(1,1,"HIGH SCORES:
1->H
For(A,1,10
TextColor(Black-(H*(L1(A)=P)
H-(L1(A)=P)->H
toString(L1(A->Str0
If not(L1(A
"--->Str0
10*fPart(A/10
Text(15A,1,A=10,Ans,": ",Str0
End

Thanks to Pieman for helping me test and make some improvements!


If there is anything I missed, please let me know!


I will probably update this somewhat frequently. Tell me what you think!
#36
Other / _iPhoenix_'s quotes thread.
May 02, 2017, 10:24:34 PM
Here's a bunch of helpful/interesting quotes from me!
I am too lazy to put quote tags around all of them, so here they are:


"The mark of a good programmer is that he/she hasn't brute forced anything in the past few years. Unless it truly cannot be done any other way..." ~ _iPhoenix_

"The smarter you get, the more idiotic mistakes you make. I guess I must be pretty smart, I walk into the same door everyday." ~ _iPhoenix_

"That code is messier than my handwriting. And that's saying something." ~ _iPhoenix_

"You call that holy, beautiful code a mess? You haven't seen anything." ~ _iPhoenix_

"This truly revolutionary mess..." ~ _iPhoenix_

'' :3= '' ~ _iPhoenix_

"PT_ is a god, I tell you." ~ _iPhoenix_ (Cemetech Quote 126)

"If Jesus died for our sin, who died for our cos and tan?" ~ _iPhoenix_ (Cemetech Quote 123)

"I am easily distracted by shiny th... Oooh shiny..."  ~ _iPhoenix_

"Saying big, unrelated words makes you sound more photosynthesis." ~ _iPhoenix_

"If someone smarter tells me it is impossible, I keep trying just to prove them wrong. I've been dividing by zero ever sense..." ~_iPhoenix_

"I switched over karmaBot and iPhoenixBot over to the Bots API, before they were working on some form of haphazard code monolith I threw together." ~ _iPhoenix_

"I accidentally banned myself" ~ _iPhoenix_

"You needed karma, because I am a lazy human" ~ _iPhoenix_

"hang on... You have more karma than me... And I made this site. " ~ _iPhoenix_

"I press a button, and it bans you. hehe [ from UniChat ]" ~ _iPhoenix_

I'll add more as I say cool things. <rant> I don't want to add this to the funny quotes thread, as these are too awesome for that filthy place of demented quotes. </rant>

Feel free to use these!
#37
Drawing & Animation / Calc animation thingie/project
April 22, 2017, 02:30:43 AM
I've had a √ idea lately. (Ok that was a bad joke) I am *attempting* to make something like Animation vs Animator 4 (look it ↑), but starring my sentient calculator. Being myself, it will be "Program vs Programmer" and I will animate the screen using code. Go figure.


It will/could have a scene where I call on Cemetech/CodeWalrus members via SAX/WalriiIRC, but I will animate those, if given permission by the respective owners.


I'm not going to leak too much, but it is completely planned out. I even went to office max a purchased a storyboard. Just to feel like I know what I am doing, even though I don't. When this project is complete, I will release my source code, but beware. It is 100% quick and dirty, with little to no optimizations. (Case in point: ~30 min in, and I have eleven nested for loops)


I will append updates to this post.
#38
The way this thread works:


Note: 'project' and 'challenge' are used interchangeably.
1) You can either improve a previous project, comment on a project, or complete a project.
2) You can only challenge people to make a project if you have completed the most recent challenge, or if it is the first post (this one)
3) You must give multiple options in your challenge. (They only have to do one)
4) You may not challenge a specific user/users.
5) Keep it reasonable: Don't challenge people to make things that are too easy, have already been done before (within reason), or are unrealistic.
6) When completing a challenge, you must release source.
7) TI-Basic only
8) Teaming with other users is allowed.
9) The first person to come up with a satisfactory result to any challenge wins that challenge. If two+ users post for the same challenge on the same day (with substantially different code), size and speed are taken into account.
10) You cannot complete your own challenge.




I enjoy doing these, and I hope the community does, too.




Here's my challenge:
a) Create a rudimentary 3D video game (not a raycaster, I already did that :P)
b) Create a Base-64 encryptor/decrypter (look it up), that inputs any alphanumeric string (and space)
c) Create a Maze generator, that the player can play in the maze. Also, create 'mobs' that pathfind to the player (health bar is optional, )
#39
Walrii tokens are things that @c4ooo was talking about, I just took the idea a step further!
Walrii tokens are like reputation points but better. You start with 100, and people can give you some, and you can give other people some.

Say DJ created a really cool game. I could give him, say, 5 walrii tokens. Assuming we both had 100, he would then have 105, and me 95.

But, to prevent people from cheating the system, you can only give a max of 20 walrii tokens per day. You can also only give once to a post, and you cannot give more than 10 per post.

You also cannot have a reputation of less than zero.

I also feel that admins should be able to hand edit scores, in case of abuse.

Walrii tokens could also be earned/used on certain games in the arcade. I think these games should be mentally challenging (i.e. Puzzle games), and you can only win from a certain game a set number of times.

Walrii tokens cannot be given/used in the Randomness topic, because that makes sense to me (I don't know why, though).

I also have a sprite, which needs improvement, but it's a start:

(imma shrink it later)


[edit]
Perhaps one could assign a 'bounty' of up to 25 Walrii Tokens, and if a person solves the problem (either according to the user, or if they abuse the system, the admins), they get the tokens.

^^ Totally didn't get that idea from stackexchange.

[edit^2]
Note: things in [] are buttons.
To clarify, here's how it would look (sort of, but neater): (for a user with 100 tokens)
In mini-profile:
x 100

To give, in post:
[Give this user ...]
Clicking that would lead to this:
Enter how many you would like to give to [name here]: ____
[ok] [cancel]

In game:
Please insert
You have 100 x
#40
I have been doing some things in the music department and thought I'd share it here :)


I have a youtube channel, and I will be posting my music projects here!

I will be sorting by project type.

Transcriptions

The Kahoot! lobby theme:


All Star - by Smash Mouth (well part of it, I'm can't be bothered to do the rest):


Misc Starwars stuff:
Link to old stuff

Wacky synths version of Canon, in D major:
Link to more old stuff

Original Compositions
Stumbling Through Math

I'm working on a really cool set of songs (my Halcyon Plains album), and I am proud to present the first, a very pretty (oooh) piece.
[spoiler=Halcyon Plains]


Second piece:


Third piece:


Fourth, and final piece:

[/spoiler]

Epsilon:
Here, on SoundCloud!

Glory:
Also on SoundCloud.

More stuff coming soon
#41
cross-over
I made probably the worst decision of my life. I am making a TI-Basic neural network.

Here's what's working:
-Perceptron/single neuron
-Input
-Weights

Here's what's not working:
-Outputs
-More than one neuron (network part of 'neural network')
-My brain
-TI-Basic

I have some code done, but it's really sloppy, and uses a lot of subprograms to keep it organized. (I'm porting from Java, ok?!) In the end, I can just paste the code from the subprograms into the main class (dang OOP is getting to me) program.

I will post progress updates here and potentially code snippets, but I'm going to take a small break from it. I spent way too much time getting to this point.

Also, this is definitely the first time anyone has done this, so I'm pretty proud of my mess code.

I will post code when I can, as I am in a very volatile state.  I currently am working on solving some of the problems of the code and do not have a working version.

I expect to be done in a week or two, but I am not sure. [edit: not happening]

Additionally, it is surprisingly fast, with one neuron/layer. The time required per layer should (this is from experience) go up exponentially, though.


Single Perceptron
Code/Download (version 1, I used a super cheatysimple activation function to give me time to re-learn basic calculus.)
[dropbox download here]

Source (optimized, credits down below, may not work 100%):

prgmPERCEPT:
Ans->|LARGS

0.1->C
If 1=|LARGS(1
seq(2rand-1,I,1,|LARGS(2->|LWTS

If 2=|LARGS(1
Then
DelVar S
For(I,3,dim(|LARGS)-1
S+|LARGS(I)*|LWTS(I-2->S
End
1-2(S<0->theta
End

If 3=|LARGS(1
Then
|LARGS(2->D
dim(|LARGS)-2->dim(|LA
DelVar S
~1+2(5>2sum(seq(|LARGS(I)*|LWTS(I-2),I,3,dim(|LARGS)-1->S
D-Ans->E
For(I,1,dim(|LWTS
C*E*|LARGS(I+2->|LB(I
|LWTS(I)+C*E*|LARGS(I+2->|LWTS(I
End
{E,S,|LB(1),|LB(2
End

last updated March 30, 2017
prgmTRAIN:
Menu("RESUME TRAINING?","YES",02,"NO",03
Lbl 03
3->dim(|LZYZYZ
Fill(0,|LZYZYZ
1->|LZYZYZ(1
ClrDraw
{1,2:prgmPERCEPT
Lbl 02

Input "NUMBER OF TRIALS: ",A
|LZYZYZ(2->I%
A->|N
Repeat not(|N
|N-1->|N
Text(0,1,|LZYZYZ(1
Text(12,1,|LZYZYZ(2
Text(24,1,|LZYZYZ(1)-|LZYZYZ(2
randInt(~100,100,2->L1
1-2(L1(1)>L1(2
augment({3,Ans},L1->|LZ
prgmPERCEPT
Ans->L1
If Ans(1
Pt-On(|LZ(3),|LZ(4),Black,3
|LZYZYZ(2)+not(Ans(1->|LZYZYZ(2
Pt-On(|LZ(3),|LZ(4),Black+L1(2),1
1+|LZYZYZ(1->|LZYZYZ(1
End

Last updated April 2, 2017

And here's the README file (text, have fun putting this on your calc), for archival purposes (and for help):
Drag both onto CE/CSE (monochrome may work)

Launch prgmTRAIN

Do not change the name of prgmPERCEPT.

Bugs/Modifications are welcome.

If there is any code that doesn't run (I'm talking about stuff in prgmPERCEPT), it is there for later versions.

Thanks!

~iPhoenix


Credits for optimizations not included in download, but in source:
mr womp womp
PT_ or P_T (can't tell anymore!)
(potentially you?)


Here's a really good image on perceptrons I found.
It explained a lot (to me, at least, a long time ago)



Here's a video about the speed (and I leaked some stuff)

Here's a great explanation (including psudocode) on what a neural network is, and how to make one.

1 layer (3 neurons) neural network
"Change to {0 (instead of {1})  if you do not want to see the nerd stuff :P
{1->|LDEBUG
rand(6->|LN1
rand(3->|LN2
DelVar theta
{0,1,0,1->|LIN1
{0,0,1,1->|LIN2
{0,1,1,0->|LIN3
Repeat 0
theta+1->theta
Disp "---","Trial Num: "+toString(theta
1+remainder(theta-1,4->I
|LIN1(I->|LINPUT(1
|LIN2(I->|LINPUT(2
|LIN3(I->Z
Disp "Expected Output: "+toString(Z
For(A,1,2
Disp "Input "+toString(A)+": "+toString(|LINPUT(A
End
Disp "---",""
DelVar P
For(A,1,3
DelVar S
For(I,0,3,3
S+|LINPUT(I/3+1)*|LN1(A+I->S
End
S->L2(A
1/(1+e^(~S->|LRES(A
End
|LRES*|LN2->|LRES

sum(|LRES->A
1/(1+e^(~A))->A
For(N,1,3
If sum(|LDEBUG:Then
Disp "Synapse "+toString(N
Disp "Expected: "+toString(Z),"Result: "+toString(A),"Error: "+toString(Z-A
End
Z-A->E
nDeriv(1/(1+e^(~B)),B,A)*E->C
If sum(|LDEBUG
Disp "Change: "+toString(C
|LN2(N->L3(N
C+|LN2(N->|LN2(N

If sum(|LDEBUG:Then
Disp "old:"+toString(L3(N
Disp "new:"+toString(|LN2(N
Disp ""
End
End
If sum(|LDEBUG
Disp "","Input-Hidden:"
For(A,1,3
L2(A->O
C*L3(A)*nDeriv(1/(1+e^(~X)),X,O)->L4(A
If sum(|LDEBUG
Disp "Change "+toString(A)+": "+toString(Ans
End
For(A,1,3
|LINPUT(1->L5(A
|LINPUT(2->L5(A+3
End
3->dim(L4
augment(L4,L4->L4
L4*L5->L5
|LN1+L5->|LN1
If sum(|LDEBUG:Then
For(A,1,12
If A<6
Disp "old: "+toString(|LN1(A)-L5(A
If A=6
Disp ""
If A>6
Disp "new: "+toString(|LN1(A-6
End
End
Disp "",""
End

End

updated April 12, 2017
^^ Code looks weird, just input it into SC3

I literally copied and pasted the code, so there may be a few bugs.
I am also not 100% sure the code works (It should), I need a day or two to run 10 thousand trials :P

I also will not (as of right now) be explaining what it writes on the homescreen, it's a huge mess.
#42
What is your favorite little-used feature of any program? (no easter eggs, unless they are actually useful!) For me, it is, well, I don't know!


I am curious about what you guys have to say, and the more frequently you use the software, the better. (People may actually use this stuff :P)
#43
Randomness / Forum Game: Counter!
March 21, 2017, 08:19:12 PM
If you don't know what a forum game is, well, it's a game you play on a forum.

In this forum game, you have a number. This post is one, the next post will be 2 AND SO ON (jeez). In your post, you post some information about you that relates you to that number. For example:


Quote from: My post, which is number oneI am 1.
I am related to this number because I have one color calculator, my CE. I tend to spend a lot of time on my CE, which can sometimes be a bad thing ;D .
I also have a single monochrome calc, but I do not spend as much time on that calculator.

Your post, of course, will be longer, as that was just a demo.

RULES:
Only post (here) twice per week, at most, and don't double post.
No profane or inappropriate comments/stories.
If you have nothing in common with the next number, reset to 1.
You cannot be the same number twice. (I cannot be one again)
You cannot reset to one to be mean. That simply makes it less fun for everyone.
No flaming.  >:( >:D (jk, but seriously, don't :thumbsup: )
The objective is to get as high as we can, but that is not the objective of the thread (It's an added objective). The objective of the thread is to have fun and learn about each other.


GO!
#44

I was told it couldn't be done. albeit by the non-programmer types
That got me agitated, so I did it.


I made the first (to my knowledge) completely pure TI-Basic raycaster.


For those who don't know what raycasting is, it is a method of drawing a 3D environment from a 2D map. It is also my area of expertise


Just input any 10x10 matrix in to [A], then it will render the first screen.
For example, I loaded the matrix displayed as a demo on the CC19 thread into [A], and got this:



There are a few things to notice:


The minimap, on the bottom right. Believe it or not, this is essential to the program, as it does all of its detection and ray projection on it. I also spent more time making the bevel look right then anything else. (This is an old version, and I forgot to put a marker for where the player is.)


The shading, which represents distance. I chose this color shading, as it was easier on the eyes. In theory, you could easily edit the program to do any color of shading you want.


The glitch, slightly left of center. This is a WIP, but I doubt I will be able to fix that. (as it is due to the way I am calculating my rays' paths/intersections, and there is no other efficient way.)


This program is not complete and I have a bit left to implement. Here we go:


1) Optimization. Currently, the 'game' is unplayable, as it takes it like 2 min to render a screen. Most of this is due to the programming language, but some of it can probably be sped up.
2) Key recognition. Not only is the 'game' too slow to be played, it does not recognize any keypresses. This is due to the fact that I wanted to post this early so you guys could all see it. Compared to the main bits, this should be really easy. (but still take awhile, arbitrary rotation measurements are not fun to work with. For example, looking forward (right on minimap) is 310 degrees. Don't ask me why.) Complete! (wow that was quick!)
3) Prettifying the code. Perhaps.
4) You tell me. I don't really know where to go with this...


litrosaist had a speed modification. x2
womp shows me I cannot type. x2


Code here, but movement is all screwed up:
Degree
0→Xmin
{BLACK,DARKGRAY,GRAY,MEDGRAY,LTGRAY,WHITE,WHITE→L₁
70→Xmax
-­20→Ymin
20→Ymax
310→R
119→S
219→T
Lbl RD


ClrDraw
For(A,1,51,1
For(B,1,100,50
Pxl-On(163-A,263-B,GRAY
Pxl-On(163-B,263-A,GRAY
Pxl-On(164-A,264-B,GRAY
Pxl-On(110+A,210+B,MEDGRAY
Pxl-On(110+B,210+A,MEDGRAY
Pxl-On(109+B,209+A,MEDGRAY
Pxl-On(109+A,209+B,MEDGRAY
End
End


For(A,1,10
For(B,1,10
If [A](A,B
Then
For(C,1,5
For(D,1,5
Pxl-On(110+(5A-4+C),210+(5B-4+D),BLACK
End
End
End
End
End
DelVar N
For(A,70-R,1-R,­1
N+1→N
DelVar C
cos(A→P
sin(A→Q
Repeat Ans
C+1→C
pxl-Test(int(S+CP),int(T+CQ
End
If C<20:Then
int(C/3→V




For(B,­int(40/C)/2,int(40/C)/2
For(D,1,2
Pt-On(N,B,D,L₁(V
End
End
End
End
Pxl-On(S,T
Repeat Ans
getKey
End
If K=24
R-2→R
If K=26
R+2→R
If K=25
Then
int(S+5cos(R→S
int(T+5sin(R→T
Else
If K=34
Then
int(S-5cos(R→S
int(T-5sin(R→T
End
End
If K=45:Stop
Goto RD



Also: There is now a code golf happening with this code!! Who ever can get it the fastest wins a small banner (for sig) and (maybe) some karma or something.
Formula (for score):
speed^2+2size
#45
Other / Fun Math/Logic Problems!
March 17, 2017, 09:54:08 PM
I got one!

With 5 eight's, and 5 basic operators (+, -, *, /, ^, plus parenthesis, of course.), is it possible to get the numbers 1 - 16 (It may be no, 16 is arbitrary ;) )?
If so: how, and how far can you go (continuously after 10)?


E.X.
(8/8)^8-(8/8) = 0


jonbush asked a very good question:
Quote from: jonbushSo we must use all five 8's, but we can use any number of operators?


Yes. NO OPERATORS/OPERATIONS NOT MENTIONED!


And no programs to try every single combo, either. Fine... I used one myself to solve it anyway...


And if you do create a program, you need to explain (prove, in short) why that particular one is impossible... :ninja:


Hints (filthy cheater :P ):


Hint #1
Hint #2

Use spoilers for your answer :P
Powered by EzPortal