Giter VIP home page Giter VIP logo

Comments (20)

Hywan avatar Hywan commented on August 16, 2024

Hello :-),

Maybe the explanations are not correctly highlighted? What do you think?

from console.

CedCannes avatar CedCannes commented on August 16, 2024

↑ ↑ ↓ ↓ ← → ← → B A ?

from console.

Hywan avatar Hywan commented on August 16, 2024

@CedCannes What?

from console.

CedCannes avatar CedCannes commented on August 16, 2024

Nothing, sorry , just all these arrows have reminded me konami code :)

from console.

Hywan avatar Hywan commented on August 16, 2024

Haha, nice idea for an easter egg :trollface:!

from console.

itskevinsam avatar itskevinsam commented on August 16, 2024

Hoa\Console\Cursor::move('← ← ← ↑ ↑');
Hoa\Console\Cursor::move('↓'); // move below
Hoa\Console\Cursor::clear('↔'); // clear the line

it would be better if you could change the examples to use [l/left] instead of the symbols (it scared me first)

Its not like i don't like the syntax, but is there any possibility for having a syntax like
Hoa\Console\Cursor::move->left(1)->up(2)->down(1) //This would make more sense (at-least for me:-) )

from console.

Hywan avatar Hywan commented on August 16, 2024

@itskevinsam What about a mix or two examples (the same one but with litteral symbols instead of unicode ones)?

from console.

itskevinsam avatar itskevinsam commented on August 16, 2024

"(the same one but with litteral symbols instead of unicode ones)?" <-- that would be great..

from console.

Hywan avatar Hywan commented on August 16, 2024

Let's have some other feedbacks. ping @hoaproject/hoackers

from console.

jubianchi avatar jubianchi commented on August 16, 2024

@Hywan 👍 for examples without unicode chars as it will be less scary for newcomers and also avoid such debates ;)

I also like @itskevinsam proposal : Hoa\Console\Cursor::move->left(1)->up(2)->down(1) 👍

from console.

CircleCode avatar CircleCode commented on August 16, 2024

from my point of view, unicode is fun, but not easy to use for everybody, so I think we should support these 3 notations:

  • [l/left], [r/right], etc. should be the preferred one for small count of move
  • Hoa\Console\Cursor::move->left(10)->up(5)->down(15) makes sense when you move far from the start point, and should also be shown in examples, and presented as an alias
  • ←↑→↓ can be supported for those knowing how to type these chars easily

edit: I know notations 1 and 3 are already supported, my point is 1. should be the preferred one and then we should show it as reference in examples

from console.

1e1 avatar 1e1 commented on August 16, 2024

@itskevinsam
You can already use ASCII/litteral symbols. Take a look at:
https://github.com/hoaproject/Console/blob/master/Cursor.php#L62-79
https://github.com/hoaproject/Console/blob/master/Cursor.php#L266-280

And I'm agree with @CircleCode: Unicode is fun!

from console.

Hywan avatar Hywan commented on August 16, 2024

We probably not create methods like left, up etc., it is too much complicated for nothing :-/ (it needs to create a dumb object just to get the ability to have a fluid interface…).
Strings like left, right and shorcuts are already supported. @itskevinsam didn't read the documentation well. My question is the following: is the documentation hard to read, or, whether @itskevinsam has read the documentation too fast? I quote the README:

For example, we can use l, left or to move the cursor on the left column. Thus we move the cursor to the left 3 times and then to the top 2 times:

Hoa\Console\Cursor::move('← ← ← ↑ ↑');

Thoughts?

from console.

itskevinsam avatar itskevinsam commented on August 16, 2024

"You can already use ASCII/litteral symbols" <-- agree with that. Checked the examples and saw
Hoa\Console\Cursor::move('← ← ← ↑ ↑'); // it would be better to replace that with another example which makes use of literal symbols.

and regarding the syntax "Hoa\Console\Cursor::move('← ← ← ↑ ↑');" <-- i wont say that its bad but "Hoa\Console\Cursor::move->left(10)->up(5)->down(15)" would make things easier to understand.

PS: "Hoa\Console\Cursor::move('l l l l l l l l l l u u u u u d d d d d...')" <-- that might make things complicated. For small use cases the syntax is good.

"documentation hard to read" <-- well no, documentation is not hard to read. But i do believe that people look for examples first (me at-least)

from console.

1e1 avatar 1e1 commented on August 16, 2024

In this case, perhaps moveTo() is better? getPosition() should be helpful.
Or keep move( str_repeat('l ', 10) . str_repeat('u ', 5) . str_repeat('d ', 15) )...
Thoughts?

from console.

Hywan avatar Hywan commented on August 16, 2024
Cursor::move('left', 10);

works perfectly also.

I will update the README to add the same example but with literals instead of symbols.

from console.

Hywan avatar Hywan commented on August 16, 2024

Better https://github.com/hoaproject/Console#cursor ?

from console.

itskevinsam avatar itskevinsam commented on August 16, 2024

"I will update the README to add the same example but with literals instead of symbols" <-- that would be great

from console.

itskevinsam avatar itskevinsam commented on August 16, 2024

and any alternatives for "clear('↔')"

line

from console.

Hywan avatar Hywan commented on August 16, 2024

@itskevinsam RTFM :-p. This is a README, not an exhaustive documentation. At this point, users understand that there is an alternative syntax. Please, see http://hoa-project.net/Literature/Hack/Console.html#Cursor, thanks :-).

from console.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.