WeixiangYan/CodeTransOcean huggingface dataset:
Task: Named parameters

C: #include <stdio.h>



typedef struct { int x, y, z; } FTest_args;

void FTest (FTest_args args) {
	printf("x: %d, y: %d, z: %d\n", args.x, args.y, args.z);
}

#define FT(...) FTest((FTest_args){ __VA_ARGS__ })




#define DFT(...) FTest((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })




void FTest2 (int x, int y, int z) {
	printf("x: %d, y: %d, z: %d\n", x, y, z);
}

static inline void FTest2_default_wrapper (FTest_args args) {
	return FTest2(args.x, args.y, args.z);
}

#define DF2(...) FTest2_default_wrapper((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })


int main(int argc, char **argv)
{
	
	FTest((FTest_args){ .y = 10 });
	FTest((FTest_args){ .y = 10, .z = 42 });
	FT( .z = 47, .y = 10, .x = 42 );

	
	DFT();
	DFT( .z = 99 );

	
	DF2();
	DF2( .z = 99 );

	return 0;
}







Python: def subtract(x, y):
    return x - y

subtract(5, 3)         
subtract(y = 3, x = 5)
Task: Named parameters


C++: class foo_params{
	friend void foo(foo_params p);
public:
    foo_params(int r):
        required_param_(r),
	optional_x_(0),
	optional_y_(1),
	optional_z_(3.1415)
	{}
     foo_params& x(int i){
	optional_x_=i;
	return *this;
     }
     foo_params& y(int i){
	optional_y_=i;
	return *this;
     }
     foo_params& z(float f){
	optional_z_=f;
	return *this;
     }
private:
        int 	required_param_;
	int 	optional_x_;
	int 	optional_y_;
	float 	optional_z_;
};



Go: package main

import (
   "fmt"
)

type params struct {x, y, z int}

func myFunc(p params) int {
    return p.x + p.y + p.z
}

func main() {
    r := myFunc(params{x: 1, y: 2, z: 3}) 
    fmt.Println("r =", r)
    s := myFunc(params{z: 3, y: 2, x: 1}) 
    fmt.Println("s =", s)
    t := myFunc(params{y: 2})             
    fmt.Println("t =", t)
}
Task: Named parameters


C++: class foo_params{
	friend void foo(foo_params p);
public:
    foo_params(int r):
        required_param_(r),
	optional_x_(0),
	optional_y_(1),
	optional_z_(3.1415)
	{}
     foo_params& x(int i){
	optional_x_=i;
	return *this;
     }
     foo_params& y(int i){
	optional_y_=i;
	return *this;
     }
     foo_params& z(float f){
	optional_z_=f;
	return *this;
     }
private:
        int 	required_param_;
	int 	optional_x_;
	int 	optional_y_;
	float 	optional_z_;
};




Java: module NamedParams
    {
    const Point(Int x, Int y)
        {
        Point with(Int? x=Null, Int? y=Null)
            {
            return new Point(x ?: this.x, y ?: this.y);
            }
        }

    @Inject Console console;

    void run()
        {
        Point origin = new Point(0, 0);
        console.print($"origin={origin}");
        Point moveRight = origin.with(x=5);
        console.print($"moveRight(x=5)={moveRight}");
        Point moveUp    = moveRight.with(y=3);
        console.print($"moveUp(y=3)={moveUp}");
        }
    }
Task: Named parameters


C++: class foo_params{
	friend void foo(foo_params p);
public:
    foo_params(int r):
        required_param_(r),
	optional_x_(0),
	optional_y_(1),
	optional_z_(3.1415)
	{}
     foo_params& x(int i){
	optional_x_=i;
	return *this;
     }
     foo_params& y(int i){
	optional_y_=i;
	return *this;
     }
     foo_params& z(float f){
	optional_z_=f;
	return *this;
     }
private:
        int 	required_param_;
	int 	optional_x_;
	int 	optional_y_;
	float 	optional_z_;
};






Python: def subtract(x, y):
    return x - y

subtract(5, 3)         
subtract(y = 3, x = 5)
Task: Named parameters


C++: class foo_params{
	friend void foo(foo_params p);
public:
    foo_params(int r):
        required_param_(r),
	optional_x_(0),
	optional_y_(1),
	optional_z_(3.1415)
	{}
     foo_params& x(int i){
	optional_x_=i;
	return *this;
     }
     foo_params& y(int i){
	optional_y_=i;
	return *this;
     }
     foo_params& z(float f){
	optional_z_=f;
	return *this;
     }
private:
        int 	required_param_;
	int 	optional_x_;
	int 	optional_y_;
	float 	optional_z_;
};







VB: Public Function timedelta(Optional weeks As Integer = 0, Optional days As Integer = 0, _
    Optional hours As Integer = 0, Optional minutes As Integer = 0, Optional seconds As Integer = 0, _
    Optional milliseconds As Integer = 0, Optional microseconds As Integer = 0) As Variant
End Function
Public Sub main()
    
    fourdays = timedelta(days:=4)
    
    
    oneday = timedelta(days = 1) 
                                        
                                        
    Dim hours As Integer
    shift = timedelta(hours:=hours) 
    
                                 
End Sub
Task: Named parameters





Java: module NamedParams
    {
    const Point(Int x, Int y)
        {
        Point with(Int? x=Null, Int? y=Null)
            {
            return new Point(x ?: this.x, y ?: this.y);
            }
        }

    @Inject Console console;

    void run()
        {
        Point origin = new Point(0, 0);
        console.print($"origin={origin}");
        Point moveRight = origin.with(x=5);
        console.print($"moveRight(x=5)={moveRight}");
        Point moveUp    = moveRight.with(y=3);
        console.print($"moveUp(y=3)={moveUp}");
        }
    }



Python: def subtract(x, y):
    return x - y

subtract(5, 3)         
subtract(y = 3, x = 5)
Task: Named parameters





Java: module NamedParams
    {
    const Point(Int x, Int y)
        {
        Point with(Int? x=Null, Int? y=Null)
            {
            return new Point(x ?: this.x, y ?: this.y);
            }
        }

    @Inject Console console;

    void run()
        {
        Point origin = new Point(0, 0);
        console.print($"origin={origin}");
        Point moveRight = origin.with(x=5);
        console.print($"moveRight(x=5)={moveRight}");
        Point moveUp    = moveRight.with(y=3);
        console.print($"moveUp(y=3)={moveUp}");
        }
    }




VB: Public Function timedelta(Optional weeks As Integer = 0, Optional days As Integer = 0, _
    Optional hours As Integer = 0, Optional minutes As Integer = 0, Optional seconds As Integer = 0, _
    Optional milliseconds As Integer = 0, Optional microseconds As Integer = 0) As Variant
End Function
Public Sub main()
    
    fourdays = timedelta(days:=4)
    
    
    oneday = timedelta(days = 1) 
                                        
                                        
    Dim hours As Integer
    shift = timedelta(hours:=hours) 
    
                                 
End Sub
Task: Named parameters




Go: package main

import (
   "fmt"
)

type params struct {x, y, z int}

func myFunc(p params) int {
    return p.x + p.y + p.z
}

func main() {
    r := myFunc(params{x: 1, y: 2, z: 3}) 
    fmt.Println("r =", r)
    s := myFunc(params{z: 3, y: 2, x: 1}) 
    fmt.Println("s =", s)
    t := myFunc(params{y: 2})             
    fmt.Println("t =", t)
}




Python: def subtract(x, y):
    return x - y

subtract(5, 3)         
subtract(y = 3, x = 5)
Task: Named parameters




Go: package main

import (
   "fmt"
)

type params struct {x, y, z int}

func myFunc(p params) int {
    return p.x + p.y + p.z
}

func main() {
    r := myFunc(params{x: 1, y: 2, z: 3}) 
    fmt.Println("r =", r)
    s := myFunc(params{z: 3, y: 2, x: 1}) 
    fmt.Println("s =", s)
    t := myFunc(params{y: 2})             
    fmt.Println("t =", t)
}





VB: Public Function timedelta(Optional weeks As Integer = 0, Optional days As Integer = 0, _
    Optional hours As Integer = 0, Optional minutes As Integer = 0, Optional seconds As Integer = 0, _
    Optional milliseconds As Integer = 0, Optional microseconds As Integer = 0) As Variant
End Function
Public Sub main()
    
    fourdays = timedelta(days:=4)
    
    
    oneday = timedelta(days = 1) 
                                        
                                        
    Dim hours As Integer
    shift = timedelta(hours:=hours) 
    
                                 
End Sub
Task: Named parameters







Python: def subtract(x, y):
    return x - y

subtract(5, 3)         
subtract(y = 3, x = 5) 


VB: Public Function timedelta(Optional weeks As Integer = 0, Optional days As Integer = 0, _
    Optional hours As Integer = 0, Optional minutes As Integer = 0, Optional seconds As Integer = 0, _
    Optional milliseconds As Integer = 0, Optional microseconds As Integer = 0) As Variant
End Function
Public Sub main()
    
    fourdays = timedelta(days:=4)
    
    
    oneday = timedelta(days = 1) 
                                        
                                        
    Dim hours As Integer
    shift = timedelta(hours:=hours) 
    
                                 
End Sub
Task: Named parameters

C: #include <stdio.h>



typedef struct { int x, y, z; } FTest_args;

void FTest (FTest_args args) {
	printf("x: %d, y: %d, z: %d\n", args.x, args.y, args.z);
}

#define FT(...) FTest((FTest_args){ __VA_ARGS__ })




#define DFT(...) FTest((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })




void FTest2 (int x, int y, int z) {
	printf("x: %d, y: %d, z: %d\n", x, y, z);
}

static inline void FTest2_default_wrapper (FTest_args args) {
	return FTest2(args.x, args.y, args.z);
}

#define DF2(...) FTest2_default_wrapper((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })


int main(int argc, char **argv)
{
	
	FTest((FTest_args){ .y = 10 });
	FTest((FTest_args){ .y = 10, .z = 42 });
	FT( .z = 47, .y = 10, .x = 42 );

	
	DFT();
	DFT( .z = 99 );

	
	DF2();
	DF2( .z = 99 );

	return 0;
}




Go: package main

import (
   "fmt"
)

type params struct {x, y, z int}

func myFunc(p params) int {
    return p.x + p.y + p.z
}

func main() {
    r := myFunc(params{x: 1, y: 2, z: 3}) 
    fmt.Println("r =", r)
    s := myFunc(params{z: 3, y: 2, x: 1}) 
    fmt.Println("s =", s)
    t := myFunc(params{y: 2})             
    fmt.Println("t =", t)
}
Task: Named parameters




Go: package main

import (
   "fmt"
)

type params struct {x, y, z int}

func myFunc(p params) int {
    return p.x + p.y + p.z
}

func main() {
    r := myFunc(params{x: 1, y: 2, z: 3}) 
    fmt.Println("r =", r)
    s := myFunc(params{z: 3, y: 2, x: 1}) 
    fmt.Println("s =", s)
    t := myFunc(params{y: 2})             
    fmt.Println("t =", t)
}


Java: module NamedParams
    {
    const Point(Int x, Int y)
        {
        Point with(Int? x=Null, Int? y=Null)
            {
            return new Point(x ?: this.x, y ?: this.y);
            }
        }

    @Inject Console console;

    void run()
        {
        Point origin = new Point(0, 0);
        console.print($"origin={origin}");
        Point moveRight = origin.with(x=5);
        console.print($"moveRight(x=5)={moveRight}");
        Point moveUp    = moveRight.with(y=3);
        console.print($"moveUp(y=3)={moveUp}");
        }
    }
Task: Named parameters

C: #include <stdio.h>



typedef struct { int x, y, z; } FTest_args;

void FTest (FTest_args args) {
	printf("x: %d, y: %d, z: %d\n", args.x, args.y, args.z);
}

#define FT(...) FTest((FTest_args){ __VA_ARGS__ })




#define DFT(...) FTest((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })




void FTest2 (int x, int y, int z) {
	printf("x: %d, y: %d, z: %d\n", x, y, z);
}

static inline void FTest2_default_wrapper (FTest_args args) {
	return FTest2(args.x, args.y, args.z);
}

#define DF2(...) FTest2_default_wrapper((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })


int main(int argc, char **argv)
{
	
	FTest((FTest_args){ .y = 10 });
	FTest((FTest_args){ .y = 10, .z = 42 });
	FT( .z = 47, .y = 10, .x = 42 );

	
	DFT();
	DFT( .z = 99 );

	
	DF2();
	DF2( .z = 99 );

	return 0;
}








VB: Public Function timedelta(Optional weeks As Integer = 0, Optional days As Integer = 0, _
    Optional hours As Integer = 0, Optional minutes As Integer = 0, Optional seconds As Integer = 0, _
    Optional milliseconds As Integer = 0, Optional microseconds As Integer = 0) As Variant
End Function
Public Sub main()
    
    fourdays = timedelta(days:=4)
    
    
    oneday = timedelta(days = 1) 
                                        
                                        
    Dim hours As Integer
    shift = timedelta(hours:=hours) 
    
                                 
End Sub
Task: Named parameters

C: #include <stdio.h>



typedef struct { int x, y, z; } FTest_args;

void FTest (FTest_args args) {
	printf("x: %d, y: %d, z: %d\n", args.x, args.y, args.z);
}

#define FT(...) FTest((FTest_args){ __VA_ARGS__ })




#define DFT(...) FTest((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })




void FTest2 (int x, int y, int z) {
	printf("x: %d, y: %d, z: %d\n", x, y, z);
}

static inline void FTest2_default_wrapper (FTest_args args) {
	return FTest2(args.x, args.y, args.z);
}

#define DF2(...) FTest2_default_wrapper((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })


int main(int argc, char **argv)
{
	
	FTest((FTest_args){ .y = 10 });
	FTest((FTest_args){ .y = 10, .z = 42 });
	FT( .z = 47, .y = 10, .x = 42 );

	
	DFT();
	DFT( .z = 99 );

	
	DF2();
	DF2( .z = 99 );

	return 0;
}






PHP: function named($args) {
  $args += ["gbv" => 2,
            "motor" => "away",
            "teenage" => "fbi"];
  echo $args["gbv"] . " men running " . $args['motor'] . " from the " . $args['teenage'];
}

named(["teenage" => "cia", "gbv" => 10]);
Task: Named parameters


C++: class foo_params{
	friend void foo(foo_params p);
public:
    foo_params(int r):
        required_param_(r),
	optional_x_(0),
	optional_y_(1),
	optional_z_(3.1415)
	{}
     foo_params& x(int i){
	optional_x_=i;
	return *this;
     }
     foo_params& y(int i){
	optional_y_=i;
	return *this;
     }
     foo_params& z(float f){
	optional_z_=f;
	return *this;
     }
private:
        int 	required_param_;
	int 	optional_x_;
	int 	optional_y_;
	float 	optional_z_;
};





PHP: function named($args) {
  $args += ["gbv" => 2,
            "motor" => "away",
            "teenage" => "fbi"];
  echo $args["gbv"] . " men running " . $args['motor'] . " from the " . $args['teenage'];
}

named(["teenage" => "cia", "gbv" => 10]);
Task: Named parameters




Go: package main

import (
   "fmt"
)

type params struct {x, y, z int}

func myFunc(p params) int {
    return p.x + p.y + p.z
}

func main() {
    r := myFunc(params{x: 1, y: 2, z: 3}) 
    fmt.Println("r =", r)
    s := myFunc(params{z: 3, y: 2, x: 1}) 
    fmt.Println("s =", s)
    t := myFunc(params{y: 2})             
    fmt.Println("t =", t)
}



PHP: function named($args) {
  $args += ["gbv" => 2,
            "motor" => "away",
            "teenage" => "fbi"];
  echo $args["gbv"] . " men running " . $args['motor'] . " from the " . $args['teenage'];
}

named(["teenage" => "cia", "gbv" => 10]);
Task: Named parameters





Java: module NamedParams
    {
    const Point(Int x, Int y)
        {
        Point with(Int? x=Null, Int? y=Null)
            {
            return new Point(x ?: this.x, y ?: this.y);
            }
        }

    @Inject Console console;

    void run()
        {
        Point origin = new Point(0, 0);
        console.print($"origin={origin}");
        Point moveRight = origin.with(x=5);
        console.print($"moveRight(x=5)={moveRight}");
        Point moveUp    = moveRight.with(y=3);
        console.print($"moveUp(y=3)={moveUp}");
        }
    }


PHP: function named($args) {
  $args += ["gbv" => 2,
            "motor" => "away",
            "teenage" => "fbi"];
  echo $args["gbv"] . " men running " . $args['motor'] . " from the " . $args['teenage'];
}

named(["teenage" => "cia", "gbv" => 10]);
Task: Named parameters






PHP: function named($args) {
  $args += ["gbv" => 2,
            "motor" => "away",
            "teenage" => "fbi"];
  echo $args["gbv"] . " men running " . $args['motor'] . " from the " . $args['teenage'];
}

named(["teenage" => "cia", "gbv" => 10]);


Python: def subtract(x, y):
    return x - y

subtract(5, 3)         
subtract(y = 3, x = 5)
Task: Named parameters






PHP: function named($args) {
  $args += ["gbv" => 2,
            "motor" => "away",
            "teenage" => "fbi"];
  echo $args["gbv"] . " men running " . $args['motor'] . " from the " . $args['teenage'];
}

named(["teenage" => "cia", "gbv" => 10]);



VB: Public Function timedelta(Optional weeks As Integer = 0, Optional days As Integer = 0, _
    Optional hours As Integer = 0, Optional minutes As Integer = 0, Optional seconds As Integer = 0, _
    Optional milliseconds As Integer = 0, Optional microseconds As Integer = 0) As Variant
End Function
Public Sub main()
    
    fourdays = timedelta(days:=4)
    
    
    oneday = timedelta(days = 1) 
                                        
                                        
    Dim hours As Integer
    shift = timedelta(hours:=hours) 
    
                                 
End Sub
Task: Guess the number_With feedback

C: #include <stdlib.h>
#include <stdio.h>
#include <time.h>

#define lower_limit 0
#define upper_limit 100

int main(){
  int number, guess;

  srand( time( 0 ) );
  number = lower_limit + rand() % (upper_limit - lower_limit + 1);

  printf( "Guess the number between %d and %d: ", lower_limit, upper_limit );

  while( scanf( "%d", &guess ) == 1 ){
    if( number == guess ){
      printf( "You guessed correctly!\n" );
      break;
    }
    printf( "Your guess was too %s.\nTry again: ", number < guess ? "high" : "low" );
  }

  return 0;
}



C#: using System;

class Program
{
    static void Main(string[] args)
    {
        const int from = 1;
        const int to = 10;

        int randomNumber = new Random().Next(from, to);
        int guessedNumber;

        Console.Write("The number is between {0} and {1}. ", from, to);
        while (true)
        {
            Console.Write("Make a guess: ");
            if (int.TryParse(Console.ReadLine(), out guessedNumber))
            {
                if (guessedNumber == randomNumber)
                {
                    Console.WriteLine("You guessed the right number!");
                    break;
                }
                else
                {
                    Console.WriteLine("Your guess was too {0}.", (guessedNumber > randomNumber) ? "high" : "low");
                }
            }
            else
            {
                Console.WriteLine("Input was not an integer.");
            }
        }

        Console.WriteLine();
        Console.WriteLine("Press any key to exit.");
        Console.ReadKey();
    }
}
Task: Guess the number_With feedback

C: #include <stdlib.h>
#include <stdio.h>
#include <time.h>

#define lower_limit 0
#define upper_limit 100

int main(){
  int number, guess;

  srand( time( 0 ) );
  number = lower_limit + rand() % (upper_limit - lower_limit + 1);

  printf( "Guess the number between %d and %d: ", lower_limit, upper_limit );

  while( scanf( "%d", &guess ) == 1 ){
    if( number == guess ){
      printf( "You guessed correctly!\n" );
      break;
    }
    printf( "Your guess was too %s.\nTry again: ", number < guess ? "high" : "low" );
  }

  return 0;
}


C++: #include <iostream>
#include <cstdlib>
#include <ctime>

int main()
{
    std::srand(std::time(0));
    int lower, upper, guess;
    std::cout << "Enter lower limit: ";
    std::cin >> lower;
    std::cout << "Enter upper limit: ";
    std::cin >> upper;
    int random_number = lower + std::rand() % ((upper + 1) - lower);

    do
    {
        std::cout << "Guess what number I have: ";
        std::cin >> guess;
        if (guess > random_number)
            std::cout << "Your guess is too high\n";
        else if (guess < random_number)
            std::cout << "Your guess is too low\n";
        else
            std::cout << "You got it!\n";
    } while (guess != random_number);

    return 0;
}
Task: Guess the number_With feedback

C: #include <stdlib.h>
#include <stdio.h>
#include <time.h>

#define lower_limit 0
#define upper_limit 100

int main(){
  int number, guess;

  srand( time( 0 ) );
  number = lower_limit + rand() % (upper_limit - lower_limit + 1);

  printf( "Guess the number between %d and %d: ", lower_limit, upper_limit );

  while( scanf( "%d", &guess ) == 1 ){
    if( number == guess ){
      printf( "You guessed correctly!\n" );
      break;
    }
    printf( "Your guess was too %s.\nTry again: ", number < guess ? "high" : "low" );
  }

  return 0;
}




Go: package main

import (
    "fmt"
    "math/rand"
    "time"
)

const lower, upper = 1, 100

func main() {
    fmt.Printf("Guess integer number from %d to %d: ", lower, upper)
    rand.Seed(time.Now().Unix())
    n := rand.Intn(upper-lower+1) + lower
    for guess := n; ; {
        switch _, err := fmt.Scan(&guess); {
        case err != nil:
            fmt.Println("\n", err, "So, bye.")
            return
        case guess < n:
            fmt.Print("Too low. Try again: ")
        case guess > n:
            fmt.Print("Too high. Try again: ")
        default:
            fmt.Println("Well guessed!")
            return
        }
    }
}
Task: Guess the number_With feedback

C: #include <stdlib.h>
#include <stdio.h>
#include <time.h>

#define lower_limit 0
#define upper_limit 100

int main(){
  int number, guess;

  srand( time( 0 ) );
  number = lower_limit + rand() % (upper_limit - lower_limit + 1);

  printf( "Guess the number between %d and %d: ", lower_limit, upper_limit );

  while( scanf( "%d", &guess ) == 1 ){
    if( number == guess ){
      printf( "You guessed correctly!\n" );
      break;
    }
    printf( "Your guess was too %s.\nTry again: ", number < guess ? "high" : "low" );
  }

  return 0;
}







Python: import random

inclusive_range = (1, 100)

print("Guess my target number that is between %i and %i (inclusive).\n"
      % inclusive_range)
target = random.randint(*inclusive_range)
answer, i = None, 0
while answer != target:
    i += 1
    txt = input("Your guess(%i): " % i)
    try:
        answer = int(txt)
    except ValueError:
        print("  I don't understand your input of '%s' ?" % txt)
        continue
    if answer < inclusive_range[0] or answer > inclusive_range[1]:
        print("  Out of range!")
        continue
    if answer == target:
        print("  Ye-Haw!!")
        break
    if answer < target: print("  Too low.")
    if answer > target: print("  Too high.")

print("\nThanks for playing.")
Task: Guess the number_With feedback

C: #include <stdlib.h>
#include <stdio.h>
#include <time.h>

#define lower_limit 0
#define upper_limit 100

int main(){
  int number, guess;

  srand( time( 0 ) );
  number = lower_limit + rand() % (upper_limit - lower_limit + 1);

  printf( "Guess the number between %d and %d: ", lower_limit, upper_limit );

  while( scanf( "%d", &guess ) == 1 ){
    if( number == guess ){
      printf( "You guessed correctly!\n" );
      break;
    }
    printf( "Your guess was too %s.\nTry again: ", number < guess ? "high" : "low" );
  }

  return 0;
}








VB: Sub GuessTheNumberWithFeedback()
Dim Nbc&, Nbp&, m&, n&, c&

    Randomize Timer
    m = 11
    n = 100
    Nbc = Int((Rnd * (n - m + 1)) + m)
    Do
        c = c + 1
        Nbp = Application.InputBox("Choose a number between " & m & " and " & n & " : ", "Enter your guess", Type:=1)
        Select Case Nbp
            Case Is > Nbc: MsgBox "Higher than target!"
            Case Is < Nbc: MsgBox "Less than target!"
            Case Else: Exit Do
        End Select
    Loop
    MsgBox "Well guessed!" & vbCrLf & "You find : " & Nbc & " in " & c & " guesses!"
End Sub