Comments (20)
Hello :-),
Maybe the explanations are not correctly highlighted? What do you think?
from console.
↑ ↑ ↓ ↓ ← → ← → B A ?
from console.
@CedCannes What?
from console.
Nothing, sorry , just all these arrows have reminded me konami code :)
from console.
Haha, nice idea for an easter egg !
from console.
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.
@itskevinsam What about a mix or two examples (the same one but with litteral symbols instead of unicode ones)?
from console.
"(the same one but with litteral symbols instead of unicode ones)?" <-- that would be great..
from console.
Let's have some other feedbacks. ping @hoaproject/hoackers
from console.
@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.
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.
@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.
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.
"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.
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.
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.
Better https://github.com/hoaproject/Console#cursor ?
from console.
"I will update the README to add the same example but with literals instead of symbols" <-- that would be great
from console.
and any alternatives for "clear('↔')"
line
from console.
@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)
- Hoa\Console\Window::copy does not work on tmux
- Proposal: Introduce an `Output` class HOT 5
- Detect when we are running in screen HOT 8
- Autocompleter: Huge number of words HOT 8
- Autocompleter: Default choice selected HOT 6
- Table component HOT 3
- Why the `GetOption::REQUIRED_ARGUMENT` does not throw `Exception` when an argument is missing ? HOT 4
- Autocompletion forgets counting extra spaces HOT 7
- unset Autocompleter HOT 2
- [Question] How to run a Hoa\Console\Processus in the background or in non blocking mode HOT 4
- Process: Async API
- Processus::run does not work on Windows HOT 16
- feat(tput) Change attributes to constants
- Readline doesn't working on Windows HOT 4
- Feature request: Console sections
- Setting the cursor position doesn't change anything
- Dependabot can't resolve your PHP dependency files
- Dependabot can't resolve your PHP dependency files
- Dependabot can't resolve your PHP dependency files
- Dependabot can't resolve your PHP dependency files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from console.