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

Show posts

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

Show posts Menu

Messages - _iPhoenix_

#61
Drawing & Animation / Re: Walrii fanart
April 17, 2018, 10:21:11 PM
With a few bytes (almost 1800 of them) of JavaScript, I managed to create a cool ASCII art :3=

Here's the code:
var f=0,a=["@L@L@L@L@L@L@L@LUQsL@K-B@L@L@L@L@LEgsL@ALAssAAs-sL@L@L@LC1ELCwoEKQsLDigELCgB@L@L@LCxILCwAsL-LAAs@sAAsL@L@LCwtRCwoJWgMhHgAABCkLDigAAQsL@L@S@AACFNTQAWIQAs@AFgAL@L@LUQsKAAMlTUYHTUkeAQ4oBkEyAQsL@LEgsANyEATU0ATU0hACwAIRZCAAsL@LC1EKAyEgFAACF-CVoDISAWGTIB@LCxIAABYAFiEhIRY-AhIRYWFjcA@LCwtQAQo-MgFAMhISEhIBYWFhYZMgEL@SACxjAAs-AhFhYWFhYWFhYWNwAL@LUAQsKAQpE1oDIBYWFhYWFhYWGTIB@LEgAsLAAsCywAIRYWFhYWFhYWFiEA@LC1AEMVoEKQ4oAyEhISAWFhYWFhceAQsLCxIACwAAYwtjACEhACEAISEWFhZCNwALCwtQBjwBCgkKAyEeAhYXHgMhIBYWGjwB@SAEI-BCACEAQkIWISEhISEhIQA3AAsLUAY8BTIGPAAFOD4WFyEeAyEhIBkyAAELEgAANyEAQgAAQhYWISEAFhYhACFCAAsLC1AABTUeAAIZNBYXIBQAAhYUAAMgGTIBCxIAFiEACwAANyEh-ACw--ISEWAAtQ-B@K-AAQsL@L@LCg-Qs=","@L@-AL@L@L@L@L@LUQsLCwoELCwoAQoAAQsL@L@L@LEgsLCwAsLAsLLAAsLAAL@L@L@LC1ELCgQsKAABCgELCw4oAQsL@L@LCxILCwALACEh-ALAsLL-@L@LCwtRCwoAAyVNRgIXHgQpDigFMgEL@L@S@AACFNTQBNTSEALCwANzcA@L@LUQoFNR4HTUYHTUkeCVoDIBo8AQsL@LEgsAISEW-WAE0AYwAhIRYWNwAL@LC1-hQCFyEhIBQ-MhIBYWGTIB@LCxIAQg-CEWACEhISEhFhYWFjcA@LCwtQBCkKBjw-MgFhYWFhYWFhYZMgEL@SA@ACwLCwAhFhYWFhYWFhYWNwAL@LUAQsKAQpDigDIBYWFhYWFhYWFx4B@LEgAsYwAsCywAIRYWFhYWFhYWFiEA@LC1ABCgAJWxNaAyEhISAWFhYWFhceAQsLCxIAQg-AsAISEhACEhISEWFhZCNwALCwtQBjwBCgY8AyEeAyAWFAMhIBYWGjwAAQsSAEI-BCACEhISEWQjcAISEhIRY3-LUQoAAhQGPAMhISEgFhpBMgMhHgMjMgELEgsAADchABYWFgAhIRYWQgAhIQAhFjcAC1EKBTQXIBQ-IUAhcgFhkyAhYUAyEgFAgLABYh-L@-AAISE3-ACw-AtRCg-QsL@L@LCg-AEL@L@="],w=f=>(atob(a[f].replace(/-/g,'AAA').replace(/@/g,'Cws')).split('').map(x=>x.charCodeAt(0).toString(10).padStart(2,0)).join('')+'1').split(.map(x=>"<tt>"+x.split('').map(x=>"M +o'/:y\n.".charAt(x)).join('').replace(/ /g,'&nbsp;')+"</tt>").join('[br /]');window.onload=x=>{d=document.body,e="innerHTML";setInterval(x=>{d[e]='';d[e]=w(f=+(f==0))},300)}
(The big strings at the beginning are like 90% of the program, they hold all of the sprite data.)


You can also see a live version of the code here. (My webpage has a style tag getting rid of the margin of the elements I am injecting.

:walrii: (there was an optimization I made that threw the "code walrus" out of sync with the "CodeWalrus")

Who else thinks this belongs on the CW 404 page? I made an embeddable version (literally changed 2 things). You can embed it in your site, and it even comes with a link to CW, so you are helping CW and getting a cool animated :walrii:, all for just one line of code (technically). What a deal!

<div id="w"></div><script>var f=0,a=["@L@L@L@L@L@L@L@LUQsL@K-B@L@L@L@L@LEgsL@ALAssAAs-sL@L@L@LC1ELCwoEKQsLDigELCgB@L@L@LCxILCwAsL-LAAs@sAAsL@L@LCwtRCwoJWgMhHgAABCkLDigA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EhIRY3-LUQoAAhQGPAMhISEgFhpBMgMhHgMjMgELEgsAADchABYWFgAhIRYWQgAhIQAhFjcAC1EKBTQXIBQ-IUAhcgFhkyAhYUAyEgFAgLABYh-L@-AAISE3-ACw-AtRCg-QsL@L@LCg-AEL@L@="],w=f=>(atob(a[f].replace(/-/g,'AAA').replace(/@/g,'Cws')).split('').map(x=>x.charCodeAt(0).toString(10).padStart(2,0)).join('')+'1').split(8).map(x=>"<tt>"+x.split('').map(x=>"M +o'/:y\n.".charAt(x)).join('').replace(/ /g,'&nbsp;')+"</tt>").join('<br>');window.onload=x=>{d=document.getElementById('w'),e="innerHTML";setInterval(x=>{d[e]=w(f=+(f==0))+"<br><br>Animated ASCII art walrus created by _iPhoenix_ for <a href='https://codewalr.us'>CodeWalrus</a>."},300);}//please don't remove my notice.</script>
#62
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)
#63
Quote from: SM84CE on April 13, 2018, 02:13:06 AM
Well, I've been on Cemetech for ~7 months...
I've got a TI84PCE, I'm interested in aeronautics, program in TI-BASIC and ICE.  I want to learn C...
Other that that (there really is no guidelines for the basics to cover...)  HI! :P

Welcome to CodeWalrus! Enjoy your stay here!
#64
General Music Talk / Re: What are you listening to?
April 14, 2018, 07:25:01 PM
This. I'm going to perform it with my school, it's going to be epic.

https://www.youtube.com/watch?v=y_qVLMptKkE
#65
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"!
#66
I've been drawing more :walrii: in study hall.


They are mostly just me trying to get better, but I have some :walrii: doing funny things as :walrii: tend to do in my drawings.


Ping me on wIRCord if I forget to post them tomorrow. I'll try to remember.
#67
Gaming / Re: Fortnite on a HP Prime!
April 11, 2018, 02:46:23 AM
This is really cool. I'm not really a HP person and I'm really not a Fortnite person, but I do support putting popular games on graphing calculators :)
#68
Quote from: xlibman on April 10, 2018, 05:42:55 PM
GO
JETS
GO!


I don't think you made your point clear enough. Do you want the Jets to lose :P
#69
Quote from: Juju on April 09, 2018, 03:27:14 AM
Twitter kinda hates this when you mass retweet people, this makes you sound like a spambot for them.

I mean, it kinda was a spam bot. But it was a benevolent spam bot.
#70
PC, Mac & Vintage Computers / Re: Gateway to Legend
April 05, 2018, 03:52:55 AM
@123outerme is letting me create (some? most? all? arbitrary amounts?) of the soundtrack for GTL!

Via WalrIRCord, I posted one of my short experiments with creating ambient music. I offered to help 123outerme with the soundtrack because I am going to have decent amounts of spare time in the coming week(s).

Today I made three tracks that are designed to be loopable, so that they can be cut off easily.

I'm not going to post them yet, because it is entirely up to 123outerme to decide which tracks he will use. All tracks he doesn't use will most likely find a home in a certain music thread of mine.

The tracks I created today were a pair of simple ambient tunes, relatively short. The other one is heavily influenced by Japanese music, but I added a Latin twist to it because why not.

#71
Web / Re: iChat
April 03, 2018, 05:46:58 PM
Quote from: _iPhoenix_ on April 01, 2018, 01:38:41 PM
Today I added usability improvements!

You can check out an example of iChat here. Just sign in with Google!

I reverted my so-called "usability improvements". It turns out that scrambling the messages people send actually makes it less usable. :(

Introducing iChat Plugins!

iChat plugins are little snippets of code that are called whenever a message is received by the client. They take message data as input and return that message data, with or without changes!

You can read more about iChat Plugins here, in my GitHub repo.

:walrii:
#72
Besides the fact that he's a big-headed jerk who regularly rapes women, I think he's a half-decent president. For free speech, he can't legally do anything.

But then again, Stalin wasn't that bad of a person if we ignore his killing 22-ish million people/greed.
#73
Web / Re: iChat
April 01, 2018, 01:38:41 PM
Today I added usability improvements!

You can check out an example of iChat here. Just sign in with Google!
#74
CodeWalrca will be great, I'm sure.

Is there a Tor thing I can use on my phone?
#75
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.
Powered by EzPortal