Discuss Scratch

deletedscratch0
Scratcher
82 posts

Shift register block

I think a shift register could be useful for a project that uses a byte that shortens itself.


._.
:::::::::::::::::::::::::::::::::::::::::::::
HACK | COLLAB | SCRIPTS
::::::::::::::::::::::::::::::::::::::::::::

70 POSTS!
TheAdriCoolManDude
Scratcher
1000+ posts

Shift register block

What would it do?


FutureBlack16
Scratcher
76 posts

Shift register block

TheAdriCoolManDude wrote:

What would it do?

I think he's meant this block:
<key [shift v] pressed?>

It would be nice for Scratch to have Shift, Ctrl, Alt, etc. inputs in this block. What we can only use inputs using this block is only numbers and letters.

Also, speaking of which, there a lot of duplicates related to this topic that suggest for more inputs.

ᖴᑌ丅ᑌᖇᗴᗷᒪᗩᑕᛕ

I try to be as respectful & helpful in Scratch forum as possible, i avoid using “Support” or “No Support” when i'm posting on suggestion forum, and i'm trying to make my posts as new scratcher friendly as possible by linking to an ITopic. I take care of necroposting, thread hijacks, etc. If you have any suggestions how to improve my posts and make my posts more helpful, be sure to click “Criticize my post” and leave a comment suggestion down below. Your feedbacks will help me to be more helpful in Scratch forum.
Community Guidelines - New scratcher? Tips here. - What is Scratch? - Criticize my posts
deletedscratch0
Scratcher
82 posts

Shift register block

FutureBlack16 wrote:

TheAdriCoolManDude wrote:

What would it do?

I think he's meant this block:
<key [shift v] pressed?>

It would be nice for Scratch to have Shift, Ctrl, Alt, etc. inputs in this block. What we can only use inputs using this block is only numbers and letters.

Also, speaking of which, there a lot of duplicates related to this topic that suggest for more inputs.
No a shift register is like a thing that shifts a byte of information back a space.


._.
:::::::::::::::::::::::::::::::::::::::::::::
HACK | COLLAB | SCRIPTS
::::::::::::::::::::::::::::::::::::::::::::

70 POSTS!
deletedscratch0
Scratcher
82 posts

Shift register block

a block like:
shift byte() ()digits 


._.
:::::::::::::::::::::::::::::::::::::::::::::
HACK | COLLAB | SCRIPTS
::::::::::::::::::::::::::::::::::::::::::::

70 POSTS!
Botcho_Otkho
Scratcher
1000+ posts

Shift register block

deletedscratch0 wrote:

FutureBlack16 wrote:

TheAdriCoolManDude wrote:

What would it do?

I think he's meant this block:
<key [shift v] pressed?>

It would be nice for Scratch to have Shift, Ctrl, Alt, etc. inputs in this block. What we can only use inputs using this block is only numbers and letters.

Also, speaking of which, there a lot of duplicates related to this topic that suggest for more inputs.
No a shift register is like a thing that shifts a byte of information back a space.
I'm sure almost nobody (me too) understood this. Can you explain in a more detailed way its function?

I see now that the circumstances of one's birth are irrelevant. It is what you do with the gift of life that determines who you are. - Mewtwo
deletedscratch0
Scratcher
82 posts

Shift register block

e.g. 1011001 shifted 1 back would be101100.


._.
:::::::::::::::::::::::::::::::::::::::::::::
HACK | COLLAB | SCRIPTS
::::::::::::::::::::::::::::::::::::::::::::

70 POSTS!
Botcho_Otkho
Scratcher
1000+ posts

Shift register block

deletedscratch0 wrote:

e.g. 1011001 shifted 1 back would be101100.
Oh, I see. I think “shift register” is an unnecessarily complicated name. Isn't the “get letters from x to y” block better?

I see now that the circumstances of one's birth are irrelevant. It is what you do with the gift of life that determines who you are. - Mewtwo
deletedscratch0
Scratcher
82 posts

Shift register block

well its for information like binary
Binary is split into bytes they look like this: 10001110


._.
:::::::::::::::::::::::::::::::::::::::::::::
HACK | COLLAB | SCRIPTS
::::::::::::::::::::::::::::::::::::::::::::

70 POSTS!
Botcho_Otkho
Scratcher
1000+ posts

Shift register block

deletedscratch0 wrote:

well its for information like binary
Binary is split into bytes they look like this: 10001110
You can use that not just for binary.

I see now that the circumstances of one's birth are irrelevant. It is what you do with the gift of life that determines who you are. - Mewtwo
Hex4Nova
Scratcher
1000+ posts

Shift register block

deletedscratch0 wrote:

e.g. 1011001 shifted 1 back would be101100.

So if I got this right:
// function source
function shift(string, n) {
  return string.slice(0, 0-n);
}
// in practice
console.log(shift("1011001", 1));
“shift” would be a very very limited function. This might be what you mean?

Last edited by Hex4Nova (Sept. 25, 2018 19:57:37)



* BIGになりたい そこのアnタ!
250th post | 500th post | 750th post | 1000th post
hexakon.net
deletedscratch0
Scratcher
82 posts

Shift register block

Hex4Nova wrote:

deletedscratch0 wrote:

e.g. 1011001 shifted 1 back would be101100.

So if I got this right:
// function source
function shift(string, n) {
  return string.slice(0, 0-n);
}
// in practice
console.log(shift("1011001", 1));
“shift” would be a very very limited function. This might be what you mean?
It is not really like a string it is like a binary/hexadeciaml value (int)


._.
:::::::::::::::::::::::::::::::::::::::::::::
HACK | COLLAB | SCRIPTS
::::::::::::::::::::::::::::::::::::::::::::

70 POSTS!
DaEpikDude
Scratcher
1000+ posts

Shift register block

Did you know that shifting 1 bit to the right is essentially the same thing as dividing by 2?

And all the world over, each nation's the same,
They've simply no notion of playing the game.
They argue with umpires, they cheer when they've won,
And they practice beforehand, which ruins the fun!
deletedscratch0
Scratcher
82 posts

Shift register block

DaEpikDude wrote:

Did you know that shifting 1 bit to the right is essentially the same thing as dividing by 2?
Actually that is not true because you would need to divide the other bits and then a bunch of problems happen.


._.
:::::::::::::::::::::::::::::::::::::::::::::
HACK | COLLAB | SCRIPTS
::::::::::::::::::::::::::::::::::::::::::::

70 POSTS!
DaEpikDude
Scratcher
1000+ posts

Shift register block

deletedscratch0 wrote:

DaEpikDude wrote:

Did you know that shifting 1 bit to the right is essentially the same thing as dividing by 2?
Actually that is not true because you would need to divide the other bits and then a bunch of problems happen.
Ok here you go

101 = 5 in decimal

shift 1 bit right:

10 = 2 in decimal (i.e. floor of 5 / 2)

or even simpler:

10 = 2

shift 1 bit right:

1 = 1 (2 / 2)

it's basically just floor of a number / 2

And all the world over, each nation's the same,
They've simply no notion of playing the game.
They argue with umpires, they cheer when they've won,
And they practice beforehand, which ruins the fun!
TheAspiringHacker
Scratcher
100+ posts

Shift register block

Why do you use the term “register?” A register is a quickly accessible storage location. Scratch doesn't deal with such low-level concepts and the block itself isn't related to registers.

Long live Kyoto Animation!
liamjohnsoncoding123
Scratcher
4 posts

Shift register block

Yeah me too

edited by kaj 13/13/2013 13:13 pm

Powered by DjangoBB